Skip to content

Commit 5276e41

Browse files
djarbzcode-asher
andauthored
Allow user Entrypoint scripts (#5194)
* Allow user Entrypoint scripts * Variable encapsulation Co-authored-by: Asher <[email protected]> * Check if Entrypoint Dir exists & run all executable * Don't create entrypoint.d by default * yarn fmt * yarn fmt * Fix for SC2044 * Revert "yarn fmt" This reverts commit 5ca347f. Co-authored-by: Asher <[email protected]>
1 parent dedd770 commit 5276e41

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ci/release-image/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ RUN ARCH="$(dpkg --print-architecture)" && \
4242
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
4343
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb
4444

45+
# Allow users to have scripts run on container startup to prepare workspace.
46+
# https://github.com/coder/code-server/issues/5177
47+
ENV ENTRYPOINTD=${HOME}/entrypoint.d
48+
4549
EXPOSE 8080
4650
# This way, if someone sets $DOCKER_USER, docker-exec will still work as
4751
# the uid will remain the same. note: only relevant if -u isn't passed to

ci/release-image/entrypoint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,10 @@ if [ "${DOCKER_USER-}" ]; then
1818
fi
1919
fi
2020

21+
# Allow users to have scripts run on container startup to prepare workspace.
22+
# https://github.com/coder/code-server/issues/5177
23+
if [ -d "${ENTRYPOINTD}" ]; then
24+
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
25+
fi
26+
2127
exec dumb-init /usr/bin/code-server "$@"

0 commit comments

Comments
 (0)