Skip to content

Commit ce50671

Browse files
Working on a version of the container that doesn't execute as root.
1 parent c5d40e5 commit ce50671

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66

77
env:
88
REGISTRY: ghcr.io
9+
DOCKER_BUILDKIT: 1
10+
BUILDKIT_PROGRESS: plain
911

1012
jobs:
1113
build-and-push-image:

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66

77
env:
88
REGISTRY: ghcr.io
9+
DOCKER_BUILDKIT: 1
10+
BUILDKIT_PROGRESS: plain
911

1012
jobs:
1113
test:

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@ RUN poetry build
1313

1414
FROM python:3.10 AS deployment
1515
LABEL maintainer="foss@spectric.com"
16+
RUN useradd -d /home/datashader datashader && \
17+
mkdir -p /home/datashader /opt/elastic_datashader/tms-cache && \
18+
chown -R datashader:datashader /home/datashader /opt/elastic_datashader
1619

17-
ENV PIP_ROOT_USER_ACTION=ignore
18-
19-
COPY --from=builder /build/dist/*.whl /opt/elastic_datashader/
20-
RUN mkdir -p /opt/elastic_datashader/tms-cache && \
21-
pip install --upgrade pip && \
22-
pip install --no-cache-dir /opt/elastic_datashader/*.whl && \
20+
USER datashader
21+
RUN mkdir /home/datashader/tmp
22+
COPY --from=builder /build/dist/*.whl /home/datashader/tmp/
23+
RUN pip install --upgrade pip && \
24+
pip install --no-cache-dir /home/datashader/*.whl && \
2325
pip install uvicorn
2426

25-
COPY deployment/logging_config.yml /opt/elastic_datashader
27+
COPY deployment/logging_config.yml /opt/elastic_datashader/
2628

2729
VOLUME ["/opt/elastic_datashader/tms-cache"]
2830
ENV DATASHADER_CACHE_DIRECTORY=/opt/elastic_datashader/tms-cache

0 commit comments

Comments
 (0)