Skip to content

Commit 285706f

Browse files
committed
Update the base image to Ubuntu 20.04 so that it could be used for both amd64 and arm64 images
Set localtime to UTC so that the installation of tzdata do not ask for selection. Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
1 parent f73500d commit 285706f

File tree

3 files changed

+68
-3
lines changed

3 files changed

+68
-3
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Upload Docker images
2+
3+
permissions:
4+
packages: write
5+
6+
on:
7+
push:
8+
branches:
9+
- 'master'
10+
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v1
20+
with:
21+
platforms: arm64
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v1
25+
26+
- name: Login to Github Docker Registry
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Set variables
34+
id: vars
35+
run: echo "::set-output name=date_tag::$(date +%y%m%d-%H%M)"
36+
37+
- name: Docker Buildx Create
38+
run: docker buildx create --use
39+
40+
- name: Build and push build-su2
41+
uses: docker/build-push-action@v2
42+
with:
43+
context: build
44+
push: true
45+
tags: ghcr.io/${{ github.repository_owner }}/su2code/build-su2:${{ steps.vars.outputs.date_tag }}
46+
platforms: linux/amd64,linux/arm64
47+
48+
- name: Build and push test-su2
49+
uses: docker/build-push-action@v2
50+
with:
51+
context: test
52+
push: true
53+
build-args: |
54+
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2code/build-su2:${{ steps.vars.outputs.date_tag }}
55+
tags: ghcr.io/${{ github.repository_owner }}/su2code/test-su2:${{ steps.vars.outputs.date_tag }}
56+
platforms: linux/amd64,linux/arm64

build/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
FROM ubuntu:18.04
1+
FROM ubuntu:20.04
2+
3+
LABEL org.opencontainers.image.source https://github.com/su2code/Docker-Builds
4+
25
ENV LANG C.UTF-8
3-
RUN apt-get update && apt-get install -y \
6+
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime
7+
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y \
8+
apt-utils \
49
python3 \
510
pkg-config \
611
python3-pip \

test/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
FROM su2code/build-su2:latest
1+
ARG BASE_IMAGE=su2code/build-su2:latest
2+
3+
FROM $BASE_IMAGE
4+
5+
LABEL org.opencontainers.image.source https://github.com/su2code/Docker-Builds
26

37
# Copies your code file from your action repository to the filesystem path `/` of the container
48
COPY runTests.sh /runTests.sh

0 commit comments

Comments
 (0)