Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ci/release-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ RUN ARCH="$(dpkg --print-architecture)" && \
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

# 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

RUN mkdir -p ${ENTRYPOINTD}

EXPOSE 8080
# 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
Expand Down
9 changes: 9 additions & 0 deletions ci/release-image/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@ if [ "${DOCKER_USER-}" ]; then
fi
fi

# Allow users to have scripts run on container startup to prepare workspace.
# https://github.com/coder/code-server/issues/5177
if [ -d "${ENTRYPOINTD}" ]; then
for f in $(find "${ENTRYPOINTD}" -type f -executable); do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooo this is slick, I like it.

echo "Running Entrypoint: ${f}"
"${f}"
done
fi

exec dumb-init /usr/bin/code-server "$@"