Use shared versions when building Docker images (#1980)

This commit is contained in:
Jonatan Kłosko 2023-06-15 14:17:03 +02:00 committed by GitHub
parent 180144d79e
commit 5ca13d4904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 4 deletions

View file

@ -66,6 +66,11 @@ jobs:
# The output is set only if there was a commit, otherwise
# we pass an empty ref and and the default is used
ref: ${{ needs.assets.outputs.sha }}
- run: |
. versions
echo "elixir=$elixir" >> $GITHUB_ENV
echo "otp=$otp" >> $GITHUB_ENV
echo "debian=$debian" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
@ -93,6 +98,8 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BASE_IMAGE=hexpm/elixir:${{ env.elixir }}-erlang-${{ env.otp }}-debian-${{ env.debian }}
docker_extras:
if: github.ref_type == 'tag'
@ -101,6 +108,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
. versions
echo "elixir=$elixir" >> $GITHUB_ENV
echo "otp=$otp" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
@ -129,7 +140,7 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BASE_IMAGE=ghcr.io/livebook-dev/utils:elixir-cuda11.8
BASE_IMAGE=ghcr.io/livebook-dev/utils:elixir-${{ env.elixir }}-erlang-${{ env.otp }}-cuda11.8
create_draft_release:
if: github.ref_type == 'tag'

View file

@ -17,6 +17,7 @@ jobs:
. versions
echo "elixir=$elixir" >> $GITHUB_ENV
echo "otp=$otp" >> $GITHUB_ENV
echo "debian=$debian" >> $GITHUB_ENV
# --- START build assets
- name: Install Erlang & Elixir
uses: erlef/setup-beam@v1
@ -74,6 +75,8 @@ jobs:
file: ./Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BASE_IMAGE=hexpm/elixir:${{ env.elixir }}-erlang-${{ env.otp }}-debian-${{ env.debian }}
render-compose-file:
name: Render Docker Compose file

View file

@ -1,4 +1,4 @@
ARG BASE_IMAGE=hexpm/elixir:1.15.0-rc.2-erlang-25.3.2-debian-bullseye-20230522-slim
ARG BASE_IMAGE
# Stage 1
# Builds the Livebook release

View file

@ -6,10 +6,9 @@ set -ex
cd "$(dirname "$0")/.."
. versions
ubuntu="focal-20230126"
docker buildx build --push --platform linux/amd64,linux/arm64 \
-t ghcr.io/livebook-dev/utils:elixir-cuda11.8 \
-t ghcr.io/livebook-dev/utils:elixir-$elixir-erlang-$otp-cuda11.8 \
--build-arg ELIXIR_VERSION=$elixir \
--build-arg ERLANG_VERSION=$otp \
--build-arg UBUNTU_VERSION=$ubuntu \

View file

@ -2,3 +2,5 @@ elixir="1.15.0-rc.2"
otp="25.3.2"
openssl="1.1.1s"
rebar3="3.22.0"
debian="bullseye-20230522-slim"
ubuntu="focal-20230126"