Archived
1
0

Allow user Entrypoint scripts

This commit is contained in:
djarbz 2022-05-11 11:49:21 -05:00 committed by GitHub
parent a02f47714e
commit 40f072a15d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -42,6 +42,11 @@ RUN ARCH="$(dpkg --print-architecture)" && \
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb
# Allow users to have scripts run on container startup to prepare workspace.
# https://github.com/coder/code-server/issues/5177
ENV ENTRYPOINTD=${HOME}/entrypoint.d
RUN mkdir -p ${ENTRYPOINTD}
EXPOSE 8080 EXPOSE 8080
# This way, if someone sets $DOCKER_USER, docker-exec will still work as # This way, if someone sets $DOCKER_USER, docker-exec will still work as
# the uid will remain the same. note: only relevant if -u isn't passed to # the uid will remain the same. note: only relevant if -u isn't passed to

View File

@ -18,4 +18,13 @@ if [ "${DOCKER_USER-}" ]; then
fi fi
fi fi
# Allow users to have scripts run on container startup to prepare workspace.
# https://github.com/coder/code-server/issues/5177
chmod u+x ${ENTRYPOINTD}/*.sh
sudo chown -R ${USER} ${ENTRYPOINTD}/*
for f in ${ENTRYPOINTD}/*.sh; do
echo "Running Entrypoint: ${f}"
bash "${f}"
done
exec dumb-init /usr/bin/code-server "$@" exec dumb-init /usr/bin/code-server "$@"