diff --git a/cmd/proxy/Dockerfile b/cmd/proxy/Dockerfile index 4ff55511..9621ff13 100644 --- a/cmd/proxy/Dockerfile +++ b/cmd/proxy/Dockerfile @@ -32,6 +32,9 @@ RUN chmod 644 /config/config.toml RUN apk add --update git git-lfs mercurial openssh-client subversion procps fossil tini && \ mkdir -p /usr/local/go +ARG USER=athens +RUN adduser -D -h /home/$USER $USER + EXPOSE 3000 ENTRYPOINT [ "/sbin/tini", "--" ] diff --git a/docs/content/install/using-docker.md b/docs/content/install/using-docker.md index b0b3581c..efb4658f 100644 --- a/docs/content/install/using-docker.md +++ b/docs/content/install/using-docker.md @@ -53,6 +53,23 @@ docker run -d -v "$($env:ATHENS_STORAGE):/var/lib/athens" ` gomods/athens:latest ``` +## Non-Root User + +The Athens docker images comes with a non-root user `athens` with `uid: 1000`, `gid: 1000` and home directory `/home/athens`. +In situations where running as root is not permitted, this user can be used instead. In all other instuctions +replace `/root/` with `/home/athens/` and set the user and group ids in the run environment to `1000`. + +```shell +docker run -d -v $ATHENS_STORAGE:/var/lib/athens \ + -e ATHENS_DISK_STORAGE_ROOT=/var/lib/athens \ + -e ATHENS_STORAGE_TYPE=disk \ + -v "$PWD/gitconfig/.gitconfig:/home/athens/.gitconfig" \ + --name athens-proxy \ + --restart always \ + -p 3000:3000 \ + -u 1000:1000 \ + gomods/athens:latest +``` ## Troubleshooting Athens in Docker