Skip to content

Commit 3beaca2

Browse files
bgauduchbgauduch
andauthored
👌 upgrade contribution by @alan-cushla (#136)
* 👌 contribution by @alan-cushla * ⚗️ testing without gcc * ⬆️ bumped all Github actions * ⬆️ update Action runner version --------- Co-authored-by: bgauduch <user.personal@users.noreply.github.com>
1 parent 7c37014 commit 3beaca2

File tree

10 files changed

+74
-46
lines changed

10 files changed

+74
-46
lines changed

.github/workflows/build-test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ env:
2323

2424
jobs:
2525
load_supported_versions:
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-22.04
2727

2828
outputs:
2929
matrix: ${{ steps.set-matrix.outputs.matrix }}
3030

3131
steps:
3232
- name: Check out the repo
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434

3535
- name: Save supported versions as output
3636
id: set-matrix
@@ -42,14 +42,14 @@ jobs:
4242
echo "::set-output name=matrix::${SUPPORTED_VERSIONS}"
4343
4444
build:
45-
runs-on: ubuntu-20.04
45+
runs-on: ubuntu-22.04
4646
needs: load_supported_versions
4747
strategy:
4848
matrix: ${{ fromJSON(needs.load_supported_versions.outputs.matrix) }}
4949

5050
steps:
5151
- name: Check out the repo
52-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
5353

5454
- name: Save branch name as env var
5555
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
@@ -64,13 +64,13 @@ jobs:
6464
run: docker image save --output ${IMAGE_NAME}_${IMAGE_TAG}.tar ${IMAGE_NAME}:${IMAGE_TAG}
6565

6666
- name: Upload image artifact
67-
uses: actions/upload-artifact@v2
67+
uses: actions/upload-artifact@v4
6868
with:
6969
name: ${{ env.IMAGE_NAME }}_${{ env.IMAGE_TAG }}
7070
path: ${{ env.IMAGE_NAME }}_${{ env.IMAGE_TAG }}.tar
7171

7272
test:
73-
runs-on: ubuntu-20.04
73+
runs-on: ubuntu-22.04
7474
needs:
7575
- build
7676
- load_supported_versions
@@ -79,7 +79,7 @@ jobs:
7979

8080
steps:
8181
- name: Checkout source
82-
uses: actions/checkout@v3
82+
uses: actions/checkout@v4
8383

8484
- name: Save branch name as env var
8585
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
@@ -88,7 +88,7 @@ jobs:
8888
run: echo "IMAGE_TAG=${BRANCH}_terraform-${{ matrix.tf_version }}_azcli-${{ matrix.azcli_version }}" >> $GITHUB_ENV
8989

9090
- name: Download image artifact
91-
uses: actions/download-artifact@v2
91+
uses: actions/download-artifact@v4
9292
with:
9393
name: ${{ env.IMAGE_NAME }}_${{ env.IMAGE_TAG }}
9494

@@ -102,7 +102,7 @@ jobs:
102102
envsubst '${TF_VERSION},${AZ_VERSION}' < tests/container-structure-tests.yml.template > tests/container-structure-tests.yml
103103
104104
- name: run structure tests
105-
uses: plexsystems/container-structure-test-action@v0.2.0
105+
uses: plexsystems/container-structure-test-action@v0.3.0
106106
with:
107107
image: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
108108
config: tests/container-structure-tests.yml

.github/workflows/dockerhub-description.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ on:
1111
- .github/workflows/dockerhub-description.yml
1212
jobs:
1313
dockerHubDescription:
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

1818
- name: Update Docker Hub Description
1919
uses: peter-evans/dockerhub-description@v3

.github/workflows/lint-dockerfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ on:
1717

1818
jobs:
1919
lint:
20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-22.04
2121

2222
steps:
2323
- name: Check out the repo
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525

2626
- name: Lint Dockerfile
2727
uses: brpaz/hadolint-action@v1.5.0

.github/workflows/push-latest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ env:
2121

2222
jobs:
2323
build_push_latest:
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525

2626
steps:
2727
- name: Check out the repo
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929

3030
- name: Retrieve latest suported versions
3131
run: |
@@ -45,7 +45,7 @@ jobs:
4545
run: docker image save -o $IMAGE_NAME-$IMAGE_TAG.tar $ORGANIZATION/$IMAGE_NAME:$IMAGE_TAG
4646

4747
- name: Upload image artifact
48-
uses: actions/upload-artifact@v2
48+
uses: actions/upload-artifact@v4
4949
with:
5050
name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}
5151
path: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}.tar

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77

88
jobs:
99
load_supported_versions:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111

1212
outputs:
1313
matrix: ${{ steps.set-matrix.outputs.matrix }}
1414

1515
steps:
1616
- name: Check out the repo
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

1919
- name: Save supported versions as output
2020
id: set-matrix
@@ -26,7 +26,7 @@ jobs:
2626
echo "::set-output name=matrix::${SUPPORTED_VERSIONS}"
2727
2828
build_push_release:
29-
runs-on: ubuntu-20.04
29+
runs-on: ubuntu-22.04
3030
needs:
3131
- load_supported_versions
3232

@@ -39,7 +39,7 @@ jobs:
3939

4040
steps:
4141
- name: Check out the repo
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4343

4444
- name: Get and save release tag
4545
run: echo "RELEASE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
@@ -60,7 +60,7 @@ jobs:
6060
run: docker image save -o ${IMAGE_NAME}-${IMAGE_RELEASE_TAG}.tar ${ORGANIZATION}/${IMAGE_NAME}:${IMAGE_RELEASE_TAG}
6161

6262
- name: Upload image artifact
63-
uses: actions/upload-artifact@v2
63+
uses: actions/upload-artifact@v4
6464
with:
6565
name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_RELEASE_TAG }}
6666
path: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_RELEASE_TAG }}.tar

Dockerfile

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Build arguments
22
ARG AZURE_CLI_VERSION
33
ARG TERRAFORM_VERSION
4-
ARG PYTHON_MAJOR_VERSION=3.9
5-
ARG DEBIAN_VERSION=bullseye-20220125-slim
4+
ARG PYTHON_MAJOR_VERSION=3.11
5+
ARG DEBIAN_VERSION=bookworm-20240211-slim
66

77
# Download Terraform binary
88
FROM debian:${DEBIAN_VERSION} as terraform-cli
99
ARG TERRAFORM_VERSION
1010
RUN apt-get update
11-
RUN apt-get install --no-install-recommends -y curl=7.74.0-1.3+deb11u1
12-
RUN apt-get install --no-install-recommends -y ca-certificates=20210119
13-
RUN apt-get install --no-install-recommends -y unzip=6.0-26
14-
RUN apt-get install --no-install-recommends -y gnupg=2.2.27-2
11+
RUN apt-get install --no-install-recommends -y curl=7.88.1-10+deb12u5
12+
RUN apt-get install --no-install-recommends -y ca-certificates=20230311
13+
RUN apt-get install --no-install-recommends -y unzip=6.0-28
14+
RUN apt-get install --no-install-recommends -y gnupg=2.2.40-1.1
1515
WORKDIR /workspace
1616
RUN curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_SHA256SUMS
1717
RUN curl -Os https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
@@ -28,21 +28,23 @@ FROM debian:${DEBIAN_VERSION} as azure-cli
2828
ARG AZURE_CLI_VERSION
2929
ARG PYTHON_MAJOR_VERSION
3030
RUN apt-get update
31-
RUN apt-get install -y --no-install-recommends python3=${PYTHON_MAJOR_VERSION}.2-3
32-
RUN apt-get install -y --no-install-recommends python3-pip=20.3.4-4
33-
RUN pip3 install --no-cache-dir setuptools==60.8.2
34-
RUN pip3 install --no-cache-dir azure-cli==${AZURE_CLI_VERSION}
31+
RUN apt-get install -y --no-install-recommends python3=${PYTHON_MAJOR_VERSION}.2-1+b1
32+
RUN apt-get install -y --no-install-recommends python3-pip=23.0.1+dfsg-1
33+
# '--break-system-packages' option prevent errors when installing items with pip, without using venv.
34+
# It's not required in a throw-away container.
35+
RUN pip3 install --no-cache-dir setuptools==69.1.1 --break-system-packages
36+
RUN pip3 install --no-cache-dir azure-cli==${AZURE_CLI_VERSION} --break-system-packages
3537

3638
# Build final image
3739
FROM debian:${DEBIAN_VERSION}
3840
LABEL maintainer="bgauduch@github"
3941
ARG PYTHON_MAJOR_VERSION
4042
RUN apt-get update \
4143
&& apt-get install -y --no-install-recommends \
42-
ca-certificates=20210119 \
43-
git=1:2.30.2-1 \
44-
python3=${PYTHON_MAJOR_VERSION}.2-3 \
45-
python3-distutils=${PYTHON_MAJOR_VERSION}.2-1 \
44+
ca-certificates=20230311 \
45+
git=1:2.39.2-1.1 \
46+
python3=${PYTHON_MAJOR_VERSION}.2-1+b1 \
47+
python3-distutils=${PYTHON_MAJOR_VERSION}.2-3 \
4648
&& apt-get clean \
4749
&& rm -rf /var/lib/apt/lists/* \
4850
&& update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_MAJOR_VERSION} 1

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ Do not hesitate to contribute by [filling an issue](https://github.com/zenika-op
9090
* check **Azure CLI** version on the [project release page](https://github.com/Azure/azure-cli/releases)
9191
* check **Terraform CLI** version (keep all minor versions from 0.11) available on the [project release page](https://github.com/hashicorp/terraform/releases)
9292
* Dockerfile:
93-
* check **base image** version [on DockerHub](https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye)
93+
* check **base image** version [on DockerHub](https://hub.docker.com/_/debian?tab=tags&page=1&name=bookworm)
9494
* check **OS package** versions on Debian package repository
95-
* Available **Git** versions on the [Debian Packages repository](https://packages.debian.org/search?suite=bullseye&arch=any&searchon=names&keywords=git)
96-
* Available **Python** versions on the [Debian packages repository](https://packages.debian.org/search?suite=bullseye&arch=any&searchon=names&keywords=python3)
95+
* Available **Git** versions on the [Debian Packages repository](https://packages.debian.org/search?suite=bookworm&arch=any&searchon=names&keywords=git)
96+
* Available **Python** versions on the [Debian packages repository](https://packages.debian.org/search?suite=bookworm&arch=any&searchon=names&keywords=python3)
9797
* same process for **all other packages**
9898
* check **Pip package** versions on [pypi](https://pypi.org/)
9999
* Github actions:

dev.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,27 @@ set -eo pipefail
1313
IMAGE_NAME="zenika/terraform-azure-cli"
1414
[[ -n $3 ]] && IMAGE_TAG=$3 || IMAGE_TAG="dev"
1515

16+
# Set platform for Hadolint image (only linux/arm64 or linux/arm64 supported)
17+
PLATEFORM="linux/$(uname -m)"
18+
1619
# Lint Dockerfile
1720
echo "Linting Dockerfile..."
18-
docker run --rm --interactive --volume "${PWD}":/data --workdir /data hadolint/hadolint:2.5.0-alpine /bin/hadolint --config hadolint.yaml Dockerfile
19-
echo "Dockerfile successfully linted!"
21+
docker container run --rm --interactive \
22+
--volume "${PWD}":/data \
23+
--workdir /data \
24+
--platform "${PLATEFORM}" \
25+
hadolint/hadolint:2.12.0-alpine /bin/hadolint \
26+
--config hadolint.yaml Dockerfile
27+
echo "Lint Successful!"
2028

2129
# Build image
2230
echo "Building images with AZURE_CLI_VERSION=${AZ_VERSION} and TERRAFORM_VERSION=${TF_VERSION}..."
23-
docker image build --build-arg AZURE_CLI_VERSION="$AZ_VERSION" --build-arg TERRAFORM_VERSION="$TF_VERSION" -t $IMAGE_NAME:$IMAGE_TAG .
31+
docker buildx build \
32+
--progress plain \
33+
--platform "${PLATEFORM}" \
34+
--build-arg AZURE_CLI_VERSION="${AZ_VERSION}" \
35+
--build-arg TERRAFORM_VERSION="${TF_VERSION}" \
36+
--tag ${IMAGE_NAME}:${IMAGE_TAG} .
2437
echo "Image successfully builded!"
2538

2639
# Test image
@@ -29,6 +42,13 @@ export AZ_VERSION=${AZ_VERSION} && export TF_VERSION=${TF_VERSION}
2942
envsubst '${AZ_VERSION},${TF_VERSION}' < tests/container-structure-tests.yml.template > tests/container-structure-tests.yml
3043
echo "Test config successfully generated!"
3144
echo "Executing container structure test..."
32-
docker container run --rm -it -v "${PWD}"/tests/container-structure-tests.yml:/tests.yml:ro -v /var/run/docker.sock:/var/run/docker.sock:ro gcr.io/gcp-runtimes/container-structure-test:v1.10.0 test --image $IMAGE_NAME:$IMAGE_TAG --config /tests.yml
45+
docker container run --rm --interactive \
46+
--volume "${PWD}"/tests/container-structure-tests.yml:/tests.yml:ro \
47+
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
48+
gcr.io/gcp-runtimes/container-structure-test:v1.15.0 test \
49+
--image ${IMAGE_NAME}:${IMAGE_TAG} \
50+
--config /tests.yml
51+
52+
# cleanup
3353
unset AZ_VERSION
3454
unset TF_VERSION

supported_versions.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
"0.14.11",
77
"0.15.5",
88
"1.0.11",
9-
"1.1.5"
9+
"1.1.9",
10+
"1.2.9",
11+
"1.3.9",
12+
"1.4.7",
13+
"1.5.7",
14+
"1.6.6",
15+
"1.7.4"
1016
],
1117
"azcli_version": [
12-
"2.33.1"
18+
"2.57.0"
1319
]
1420
}

tests/container-structure-tests.yml.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ commandTests:
1111
- name: "Check Python version"
1212
command: "python"
1313
args: ["--version"]
14-
expectedOutput: ["Python 3.9.2"]
14+
expectedOutput: ["Python 3.11.2"]
1515

1616
- name: "Check Git version"
1717
command: "git"
1818
args: ["--version"]
19-
expectedOutput: ["git version 2.30.2"]
19+
expectedOutput: ["git version 2.39.2"]
2020

2121
- name: "Check Terraform CLI version"
2222
command: "terraform"

0 commit comments

Comments
 (0)