Skip to content

Dockerfile: Separate cli follow-up#45697

Merged
thaJeztah merged 2 commits intomoby:masterfrom
vvoland:dockerfile-separate-cli-2
Jun 5, 2023
Merged

Dockerfile: Separate cli follow-up#45697
thaJeztah merged 2 commits intomoby:masterfrom
vvoland:dockerfile-separate-cli-2

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Jun 5, 2023

A few small changes I didn't manage to push in time before the #45358 got merged 😄 🥷

hack/cli.sh: Quiet origin remove

Don't show error: No such remote: 'origin' error when building for the first time and the cached git repository doesn't a remote yet.

Dockerfile: Move dockercli to base-dev

Avoids invalidation of dev-systemd-true and dev-base when changing the CLI version/repository.
This saves around 30s on my machine.

@vvoland vvoland added status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. impact/dockerfile area/testing labels Jun 5, 2023
@vvoland vvoland added this to the 25.0.0 milestone Jun 5, 2023
@vvoland vvoland requested a review from tianon as a code owner June 5, 2023 14:45
vvoland added 2 commits June 5, 2023 17:02
Don't show `error: No such remote: 'origin'` error when building for the
first time and the cached git repository doesn't a remote yet.

Signed-off-by: Paweł Gronowski <[email protected]>
Avoids invalidation of dev-systemd-true and dev-base when changing the
CLI version/repository.

Signed-off-by: Paweł Gronowski <[email protected]>
Comment on lines 472 to 473
VOLUME /home/unprivilegeduser/.local/share/docker
COPY --link --from=dockercli /build/ /usr/local/cli
COPY --link --from=dockercli-integration /build/ /usr/local/cli-integration
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one slightly confused me; we don't use the CLI in this stage, or is it always used as "parent" for another stage? (because we do set the ENTRYPOINT 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we use the CLI in this stage at all -- we can use it in the next stage which is closer to where it's needed, as I read it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stage isn't used on its own - it's used as a parent of dev-systemd-false or as a parent for dev-base (if the SYSTEMD is false).
The entrypoint is set at this stage to be inherited by the dev-base depending on whether we want the systemd or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entrypoint is set at this stage to be inherited by the dev-base depending on whether we want the systemd or not.

Ah! That's the part I missed; yes, one uses this;

ENTRYPOINT ["hack/dind"]

And the other uses

ENTRYPOINT ["hack/dind-systemd"]

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit ccfc2e5 into moby:master Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing impact/dockerfile kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. process/cherry-picked status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants