-
Notifications
You must be signed in to change notification settings - Fork 439
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
prepend dockerCommands #1437
prepend dockerCommands #1437
Conversation
At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user |
Usage in build.sbt: |
At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user |
Not sure if a separate tasks is the way to go here. Prepending (not inserting into an arbitrary position) should be doable with dockerCommands := List("foo", "bar") ++ dockerCommands.value Maybe this is something for the documentation? |
That will break the build as the commands will be before "FROM". |
At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user |
At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user |
Thanks @frankivo for keeping this PR up-to-date. I'm still unsure that this setting is a good idea. It may cause more confusion that help and creates a precedence for settings that insert docker commands in arbitrary positions. The main issue from what I understand is finding the right spot to insert aditional docker commands. What do you think of
For example FROM openjdk:8 as stage0
# stage0:after:from
WORKDIR /opt/docker
COPY opt /opt
USER root
RUN ["chmod", "-R", "u=rX,g=rX", "/opt/docker"]
FROM openjdk:8
# image:after:from
RUN id -u daemon || useradd --system --create-home --uid 1001 --gid 0 daemon
WORKDIR /opt/docker
# image:after:workdir
COPY --from=stage0 --chown=daemon:root /opt/docker /opt/docker
USER 1001
ENTRYPOINT []
CMD [] and the dockerCommands := prependDockerCommandAfter(dockerCommands.value, Docker.ImageWorkdir, List(...)) this is not super elegant. But you get the idea. This is a more extendible approach. If you have a better API, feel free 😄 |
@muuki88 I like that idea actually. Don't have much time this week, but I'll see if I can update this PR with your suggestion. |
At least one pull request committer is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user |
I implemented your suggestions @muuki88. We could add more, but first let me know what you think. Example usage: frankivo/covid-telegram@89b1a03 |
Thanks a lot. I'll take a look ASAP. 🤗❤️ |
I have not forgotten this pull request 😘😘 |
Trying to fix #1417. Not sure if this is they way, feel free to comment :)