Docker Hub images#405
Conversation
[ci skip]
|
@simonlegrand, the structure between Docker and your stuff is not matching precisely, see https://github.com/FreeFem/FreeFem-sources/actions/runs/29691285093, so let me know what adjustments should be made, please. |
There was a problem hiding this comment.
Pull request overview
Adds first-class Docker image build/publish support to the release workflow, including a multi-stage Dockerfile and release asset exports, so FreeFEM can be distributed via Docker Hub and GitHub Releases.
Changes:
- Add a multi-stage
etc/docker/Dockerfilethat builds FreeFEM from source and provides a runtime image with a basic smoke test. - Extend
.github/workflows/releases.ymlto build/push per-arch images, publish a multi-platform manifest, and attach exported image tarballs to GitHub Releases. - Add a
.dockerignoreto reduce Docker build context size and avoid copying build artifacts into image builds.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
etc/docker/Dockerfile |
Defines builder/runtime stages to compile and run FreeFEM inside an Ubuntu 24.04 container. |
.github/workflows/releases.yml |
Adds Docker build + multi-arch publish jobs and includes Docker image tarballs in release assets. |
.dockerignore |
Excludes common build outputs and large 3rd-party directories from Docker build context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: amd64 | ||
| platform: linux/amd64 | ||
| runner: ubuntu-24.04 | ||
| - arch: arm64 | ||
| platform: linux/arm64 | ||
| runner: ubuntu-24.04-arm |
There was a problem hiding this comment.
I would put this in the set_versions job, in variables like docker_versions and docker_arch.
| windows_versions: ${{ needs.set_versions.outputs.windows_versions }} | ||
| ubuntu_versions: ${{ needs.set_versions.outputs.ubuntu_versions }} | ||
|
|
||
| build_docker: |
There was a problem hiding this comment.
If you want to follow the previous structure, you can create instead a get_docker job that uses a callable release_docker.yml workflow with the docker_versions and docker_arch parameters (see comment below). In this workflow you would call the build_docker job.
| | gzip --best \ | ||
| > "docker-assets/FreeFEM-${VERSION}-docker-linux-${ARCH}.tar.gz" | ||
| docker image rm "${IMAGE}" | ||
| done | ||
|
|
||
| - name: Upload Docker release artifacts | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: docker-images-${{ needs.set_versions.outputs.ff_version }} | ||
| path: ./docker-assets/* | ||
| if-no-files-found: error | ||
| compression-level: 0 | ||
| retention-days: 1 |
There was a problem hiding this comment.
Why don't you directly create and upload the tar.gz in the build_docker job?
| if-no-files-found: error | ||
| retention-days: 1 | ||
|
|
||
| publish_docker: |
There was a problem hiding this comment.
Seems ok, might be moved in separate workflow?
| && ./reconfigure | ||
|
|
||
| RUN make -j"${MAKE_JOBS}" \ | ||
| && make install |
There was a problem hiding this comment.
We could remove static libraries to save some space, with somethin like:
&& find /usr/local/lib -name '*.a' -delete \
&& find /usr/local/lib -name '*.la' -delete
| freeglut3-dev \ | ||
| g++ \ | ||
| gcc \ | ||
| gfortran \ | ||
| libfftw3-dev \ | ||
| libhdf5-dev \ | ||
| libopenblas-dev \ |
There was a problem hiding this comment.
I'd install non -dev versions instead.
| @@ -0,0 +1,96 @@ | |||
| # syntax=docker/dockerfile:1 | |||
|
|
|||
| FROM ubuntu:24.04 AS builder | |||
There was a problem hiding this comment.
We could try debian:bookworm instead, so that debian:bookworm-slim image can be used at runtime and optimize a bit the size of the image.
No description provided.