Skip to content
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

[quarkus-container-image-docker] Build docker image with --pull option and more #33866

Closed
Jacopo47 opened this issue Jun 7, 2023 · 2 comments · Fixed by #33876
Closed

[quarkus-container-image-docker] Build docker image with --pull option and more #33866

Jacopo47 opened this issue Jun 7, 2023 · 2 comments · Fixed by #33876
Labels
Milestone

Comments

@Jacopo47
Copy link

Jacopo47 commented Jun 7, 2023

Description

Let's take the initial dockerfile proposed by Quarkus in order to build a docker image with a native application:

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6
WORKDIR /work/
RUN chown 1001 /work \
    && chmod "g+rwX" /work \
    && chown 1001:root /work
COPY --chown=1001:root target/*-runner /work/application

EXPOSE 8080
USER 1001

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

My need is to not consider any kind cache while building. So, using plain docker command, something like: docker build --pull --no-cache .

But looking at Quarkus' docker documentation: https://quarkus.io/guides/container-image#DockerOptions I don't find any useful option.

Looking at this class: https://github.com/quarkusio/quarkus/blob/main/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java

I wasn't able to recognize any part in which is handling these options.

Implementation ideas

I think that it would be helpful a property that allows to specify a list of additional options.
Something like:

quarkus.docker.options=--no-cache --pull --whatever-you-need

P.S. Originally reported on SO.

@Jacopo47 Jacopo47 added the kind/enhancement New feature or request label Jun 7, 2023
@geoand
Copy link
Contributor

geoand commented Jun 7, 2023

I think it would be reasonable to add options for --no-cache and --pull to DockerConfig.

@geoand
Copy link
Contributor

geoand commented Jun 7, 2023

Actually you are probably right, giving users the ability to add whatever flags they want probably makes most sense and that is what #33876 does.

geoand added a commit to geoand/quarkus that referenced this issue Jun 7, 2023
gsmet added a commit that referenced this issue Jun 8, 2023
Allow users to specify arbitrary arguments to docker build
@quarkus-bot quarkus-bot bot added this to the 3.2 - main milestone Jun 8, 2023
michelle-purcell pushed a commit to michelle-purcell/quarkus that referenced this issue Jun 8, 2023
sberyozkin pushed a commit to sberyozkin/quarkus that referenced this issue Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants