-
Notifications
You must be signed in to change notification settings - Fork 519
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
Add a docker recipe for rebar3 itself #2423
Conversation
Probably makes sense for us to have one that way. I was wondering if it would also make sense to go for something as in https://adoptingerlang.org/docs/production/docker/ and push for a multi-stage build that handles releases as a template but I guess that's fully distinct from what we have here. |
I suppose this PR is a step in that direction, i'm using those very same instructions at For future reference purposes something like this:
|
Dockerfile
Outdated
COPY --from=builder /root/rebar3/_build/prod/bin/rebar3 . | ||
|
||
# and install it | ||
RUN install -v ./rebar3 /usr/local/bin/ \ |
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.
I'd prefer this used rebar3 local install
. You can set HOME
to /opt
in the instruction and then create a link from /usr/local/bin/rebar3
to /opt/.cache/rebar3/bin/rebar3
.
Patch I've been meaning to make is to have local install
properly use XDG_CACHE_DIR
and then you could set that to /opt/
and it'd install to /opt/rebar3/
instead of that .cache
directory.
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.
updated
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.
update the comment above. With these changes, you'll also need to copy over /opt/.cache/rebar3
besides the rebar3
binary, is this better somehow?
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.
Oh, didn't think about the use of copying it into another image. Argh, annoying, it is far better to use the unpacked version when calling from Entrypoint, so people default to that, but is a pain when copying.
I guess you can just undo my suggested change. It'd probably be confusing if there was both the rebar3 escript and the local install copy.
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.
If properly documented, people will copy/paste the two lines over to their own docker images. What is being offered through the local install
method additionally to install -v
?
btw, install -v
is the method used in the official Erlang docker images
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.
Yea, I want to change that in those too.
local install offers it not being an escript, which among making it slightly more efficient means the terminal doesn't get all screwed up if the user ctrl-c
's out of the shell.
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.
ah nice, we should keep local install
then
Based on the closest Alpine Erlang version currently supported by rebar3. Allows people to mix and match different versions of the Erlang VM and rebar3 using multi-stage builds.
ee178c0
to
f228df2
Compare
Based on the closest Alpine Erlang version currently supported by
rebar3. Allows people to mix and match different versions of
the Erlang VM and rebar3 using multi-stage docker builds.