未验证 提交 5276e416 编写于 作者: D djarbz 提交者: GitHub

Allow user Entrypoint scripts (#5194)

* Allow user Entrypoint scripts

* Variable encapsulation
Co-authored-by: NAsher <ash@coder.com>

* 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 5ca347f36155ec731587c1ed8437bca332c76693.
Co-authored-by: NAsher <ash@coder.com>
上级 dedd770a
......@@ -42,6 +42,10 @@ 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
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
......
......@@ -18,4 +18,10 @@ 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
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
fi
exec dumb-init /usr/bin/code-server "$@"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册