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

chore(mr): support fine graded multi-stages #2

Merged
merged 7 commits into from
Oct 27, 2024
Merged

chore(mr): support fine graded multi-stages #2

merged 7 commits into from
Oct 27, 2024

Conversation

rexut
Copy link
Member

@rexut rexut commented Oct 11, 2024

The Dockerfile now provides two more specific stages for the basic setup and the ASDF installation. These follow a fixed sequence that is guaranteed to be kept by restructuring the GitHub workflow. Support for multiple platforms is retained and makes use of the Docker build cache on the Docker registry where possible.

@rexut rexut force-pushed the devel branch 30 times, most recently from cbae342 to f2b1aea Compare October 12, 2024 00:53
@rexut rexut force-pushed the devel branch 7 times, most recently from 39f62f6 to 0078852 Compare October 13, 2024 05:02
@rexut rexut self-assigned this Oct 13, 2024
@rexut rexut added this to the v2024.10.1 milestone Oct 13, 2024
@rexut rexut added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Oct 13, 2024
In preparation for a differentiated CI pipeline, the Dockerfile
can now be used with finer-grained multi-stages to build multi-
platform Docker images.

ubuntu:noble-20240904.1
|
`–[base]
   | - Ubuntu system package upgrades
   | - Ubuntu APT software management utils
   | - Ubuntu localization for 'en_US.UTF-8' and 'de_DE.UTF-8'
   | - TSN workspace user in '/home/tsn' ('UID=1005' and 'GID=205')
   | - Set main entry point to '/bin/bash'
   | - Switch to TSN workspace user in '/home/tsn'
   |
   `–[asdf-all]
     | - Ubuntu system packages for ASDF
     | - Install ASDF
     | - Install ASDF Plugin Manager
     | - Switch to TSN workspace user in '/home/tsn'
     |
     +–[asdf-amd64]
     | | - Empty, nothing to do.
   ,–:–´
   | |
   | +–[asdf-arm]
   | | | - Empty, nothing to do.
   +–:–´
   | |
   | +–[asdf-arm64]
   | | | - Empty, nothing to do.
   +–:–´
   | |
   | +–[asdf-riscv64]
   | | | - Empty, nothing to do.
   +–:–´
   | |
   | +–[asdf-ppc64le]
   | | | - Empty, nothing to do.
   +–:–´
   | |
   | `–[asdf-s390x]
   |   | - Empty, nothing to do.
   +–––´
   |
   `–[asdf]:
       - Verify ASDF, execute CLI.
       - Verify ASDF Plugin Manager, execute CLI.

Signed-off-by: Stephan Linz <[email protected]>
@rexut rexut force-pushed the devel branch 6 times, most recently from ee00e17 to aab98d7 Compare October 19, 2024 13:27
Only the instructions RUN, COPY, and ADD create layers. Other
instructions create temporary intermediate images, and do not
increase the size of the build (number of layers). However,
there is a limit of 127 layers in the final image. It is
therefore recommended to offer Dockerfiles in which the number
of layers created has been reduced.

Always combine RUN apt-get update with apt-get install in the
same RUN statement is a common way to do so. For details, see:

- https://emmer.dev/blog/reducing-docker-layers
- https://docs.docker.com/build/building/best-practices/#run

Test with:

  docker inspect tiacsys/tsn-asdf-ws:local | \
         jq '.[0].RootFS.Layers[]' | wc -l

Possible to squash:

  docker image save tiacsys/tsn-asdf-ws:local | \
  docker import - tiacsys/tsn-asdf-ws:squash && \
  docker inspect tiacsys/tsn-asdf-ws:squash | \
         jq '.[0].RootFS.Layers[]' | wc -l

Signed-off-by: Stephan Linz <[email protected]>
Use our own reusable GitHub workflows for Docker from:

- tiacsys/github-workflows/.github/workflows/docker-stages.yml@v1
- tiacsys/github-workflows/.github/workflows/docker-retention.yml@v1

Use our own reusable GitHub workflows for Retry on Failure from:

- tiacsys/github-workflows/.github/workflows/retry-workflow.yml@v1

Signed-off-by: Stephan Linz <[email protected]>
Use 'latest' image from https://hub.docker.com/_/ubuntu with the
specific tag 'noble-20241011'.

Signed-off-by: Stephan Linz <[email protected]>
@rexut rexut marked this pull request as ready for review October 27, 2024 09:14
@rexut rexut merged commit 54df0aa into main Oct 27, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant