diff --git a/sample-apps/data-loader/Dockerfile b/sample-apps/data-loader/Dockerfile index 17fdd9650..22eea059b 100644 --- a/sample-apps/data-loader/Dockerfile +++ b/sample-apps/data-loader/Dockerfile @@ -1,7 +1,12 @@ FROM python:3.8-slim -COPY app.py / +COPY app.py /usr/local/bin RUN pip install foundationdb==6.2.10 +RUN groupadd --gid 4059 fdb && \ + useradd --gid 4059 --uid 4059 --shell /usr/sbin/nologin fdb -CMD python /app.py +# Set to the numeric UID of fdb user to satisfy PodSecurityPolices which enforce runAsNonRoot +USER 4059 + +ENTRYPOINT [ "python", "/usr/local/bin/app.py" ] diff --git a/sample-apps/data-loader/app.py b/sample-apps/data-loader/app.py index 948c315b5..b6f492ac4 100755 --- a/sample-apps/data-loader/app.py +++ b/sample-apps/data-loader/app.py @@ -25,7 +25,6 @@ def write_batch(tr, batch_size, value_size): for _ in range(0, value_size): value.append(random.randint(0, 255)) tr[key] = bytes(value) - pass def load_data(keys, batch_size, value_size): @@ -36,8 +35,6 @@ def load_data(keys, batch_size, value_size): print("Writing batch %d" % batch) write_batch(db, batch_size, value_size) - pass - if __name__ == "__main__": parser = argparse.ArgumentParser(description="Load random data into FDB") diff --git a/sample-apps/data-loader/job.yaml b/sample-apps/data-loader/job.yaml index ba6adce18..a91211e5f 100644 --- a/sample-apps/data-loader/job.yaml +++ b/sample-apps/data-loader/job.yaml @@ -7,7 +7,7 @@ spec: template: spec: containers: - - image: fdb-data-loader + - image: foundationdb/fdb-data-loader:latest imagePullPolicy: IfNotPresent name: fdb-data-loader env: @@ -31,8 +31,6 @@ spec: - "--copy-library" - "6.3" - "--copy-library" - - "6.1" - - "--copy-library" - "6.2" - "--init-mode" - "--require-not-empty" @@ -51,4 +49,4 @@ spec: - key: cluster-file path: fdb.cluster - name: dynamic-conf - emptyDir: {} \ No newline at end of file + emptyDir: {}