Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker] Run dexc as non-root user #2035

Merged
merged 1 commit into from Jan 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions client/Dockerfile
Expand Up @@ -6,7 +6,7 @@
# $ docker volume create --name=dcrdex_data
#
# Run the docker image, mapping web access port.
# $ docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/root/.dexc user/dcrdex
# $ docker run -d --rm -p 127.0.0.1:5758:5758 -v dcrdex_data:/dex/.dexc user/dcrdex
#

# frontend build
Expand All @@ -28,7 +28,11 @@ RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build

# Final image
FROM debian:buster-slim
WORKDIR /root
RUN apt-get update && apt-get install -y ca-certificates
WORKDIR /dex
ENV HOME /dex
RUN mkdir -p /dex/.dexc && chown 1000 /dex/.dexc
USER 1000
COPY --from=gobuilder /root/dex/client/cmd/dexc/dexc ./
COPY --from=gobuilder /root/dex/client/cmd/dexcctl/dexcctl ./
COPY --from=gobuilder /root/dex/client/webserver/site ./site
Expand Down