-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Allow user Entrypoint scripts #5194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
You'll want to run |
Thank you for adding this! This is an awesome improvement! 🎉 |
ci/release-image/entrypoint.sh
Outdated
bash "${f}" | ||
done | ||
if [ -d "${ENTRYPOINTD}" ]; then | ||
for f in $(find "${ENTRYPOINTD}" -type f -executable); do |
There was a problem hiding this comment.
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.
So I did that, I think correctly, I don't have experience with npm and yarn. Edit: scratch that, I committed the wrong stuff. |
We should drop the commit that updates prettier and the lockfiles since those are unrelated changes and seem to be causing Trivy to freak out. 😆 |
I'm with you on that, unfortunately I am anything but a git expert and I'm not quite sure what I need to do to drop that commit. |
I think the easiest way is probably to do |
This reverts commit 5ca347f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🎉 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## main #5194 +/- ##
=======================================
Coverage 71.73% 71.73%
=======================================
Files 30 30
Lines 1663 1663
Branches 367 367
=======================================
Hits 1193 1193
Misses 403 403
Partials 67 67 Continue to review full report at Codecov.
|
Thanks for working with me on this one! |
I'm not sure if I'm using this enhancement correctly, but the following part in my Dockerfile created the
For me there is not env |
Interesting, I personally overwrite the directory to root anyways for my needs. I see that As a fix, I might propose that we hard-code the path. In your particular case, I would probably want it outside the home directory anyways in case an end user decides to bind mount the home dir. |
You are absolutely right that it would be better to hardcode it, but I would prefer For me it was a bit confusing that it is defined like So to not confuse users, I would suggest changing it to |
If you are in control of the Docker image could you just write your own |
Fixes #5177
I created an ENV for easy changing of the
entrypoint.d
location in case it is ever wanted/needed to move it out of the home directory. This also would allow for the end user to set an ENVIRONMENT variable to specify a custom mount path as the entrypoint code is dynamic.