mirror of https://github.com/coder/coder.git
fix: add writeable home dir to docker image (#3603)
This commit is contained in:
parent
68e17921f0
commit
369a9fb535
12
Dockerfile
12
Dockerfile
|
@ -15,12 +15,16 @@ LABEL \
|
|||
org.opencontainers.image.version="$CODER_VERSION" \
|
||||
org.opencontainers.image.licenses="AGPL-3.0"
|
||||
|
||||
# Create coder group and user. We cannot use `addgroup` and `adduser` because
|
||||
# they won't work if we're building the image for a different architecture.
|
||||
COPY --chown=root:root --chmod=644 group passwd /etc/
|
||||
|
||||
# The coder binary is injected by scripts/build_docker.sh.
|
||||
COPY --chown=coder:coder --chmod=755 coder /opt/coder
|
||||
|
||||
# Create coder group and user. We cannot use `addgroup` and `adduser` because
|
||||
# they won't work if we're building the image for a different architecture.
|
||||
COPY --chown=root:root --chmod=644 group passwd /etc/
|
||||
COPY --chown=coder:coder --chmod=700 empty-dir /home/coder
|
||||
|
||||
USER coder:coder
|
||||
ENV HOME=/home/coder
|
||||
WORKDIR /home/coder
|
||||
|
||||
ENTRYPOINT [ "/opt/coder", "server" ]
|
||||
|
|
|
@ -110,6 +110,7 @@ docker rm "$temp_container_id" 1>&2
|
|||
|
||||
echo "coder:x:1000:coder" >>./group
|
||||
echo "coder:x:1000:1000::/:/bin/sh" >>./passwd
|
||||
mkdir ./empty-dir
|
||||
|
||||
docker buildx build \
|
||||
--platform "$arch" \
|
||||
|
|
Loading…
Reference in New Issue