-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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!
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!
Co-authored-by: Asher <ash@coder.com>
You'll want to run yarn fmt
again to fix CI ICYDK.
Thank you for adding this! This is an awesome improvement! 🎉
ci/release-image/entrypoint.sh
Outdated
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.
You'll want to run
yarn fmt
again to fix CI ICYDK.
So I did that, I think correctly, I don't have experience with npm and yarn.
Looks like it is still complaining about it?
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. 😆
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 git revert 5ca347f36155ec731587c1ed8437bca332c76693
and then push the resulting commit.
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
Merging #5194 (c724078) into main (dedd770) will not change coverage.
The diff coverage isn/a
.
@@ 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.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update dedd770...c724078. Read the comment docs.
Thanks for working with me on this one!
jneuhauser
commented
Oct 20, 2022
I'm not sure if I'm using this enhancement correctly, but the following part in my Dockerfile created the entrypoint.d
directory in /
instead of /home/coder
.
FROM codercom/code-server:latest
COPY entrypoint.d/* ${ENTRYPOINTD}/
For me there is not env HOME
defined in the docker build process and therefore ENTRYPOINTD
is always set to /entrypoint.d
.
Interesting, I personally overwrite the directory to root anyways for my needs. I see that HOME
is set inside the VSCode shell, but that may be an artifact from that particular shell.
As a fix, I might propose that we hard-code the path.
ENV ENTRYPOINTD=/home/coder/entrypoint.d
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.
jneuhauser
commented
Oct 20, 2022
You are absolutely right that it would be better to hardcode it, but I would prefer /entrypoint.d
so that mounting a volume/directory to /home/coder
remains possible.
For me it was a bit confusing that it is defined like ENV ENTRYPOINTD=${HOME}/entrypoint.d
.
So to not confuse users, I would suggest changing it to ENV ENTRYPOINTD=/entrypoint.d
.
If you are in control of the Docker image could you just write your own RUN
commands? My understanding was that entrypoint.d
was specifically for end users who have no control over the image (thus you want it in a writable place that gets mounted). Quite possibly I am misunderstanding the use case though.
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.