Skip to content

Commit 8c12279

Browse files
bgauduchbgauduch
and
bgauduch
authored
Update Debian base image, terraform version and dependencies (#51)
* remove generated container struture test config * add support for tf 1.0.2 * rename local dev script * correct typos in dockerignore config * move to debian bullseye base iamge, update dependancies and related tests * correct some comment and filters in actions * update readme Co-authored-by: bgauduch <[email protected]>
1 parent 71112e5 commit 8c12279

11 files changed

+44
-91
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# explicitely exclude all files from the build context
2-
# (each file needed in the Dockefile need to be included manually)
2+
# (each file needed in the Dockefile needs to be included manually)
33
*
44

55
# Specific to Terraform installation

.github/workflows/build-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- "hashicorp.asc"
1717
- "tests/*"
1818
- ".dockerignore"
19+
- "hadolint.yaml"
1920
- ".github/workflows/build-test.yml"
2021

2122
env:

.github/workflows/dockerhub-description-update.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: dockerhub-description-update
2+
3+
# trigger on any push on master
4+
# only for readme related modifications
25
on:
36
push:
47
branches:

.github/workflows/lint-dockerfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: lint-dockerfile
22

33
# trigger on any push
44
# but not on master or tags
5-
# and only for dockerfile modifications
5+
# and only for dockerfile related modifications
66
on:
77
push:
88
tags-ignore:

.github/workflows/push-latest.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: push-latest
22

33
# trigger on push to master
4-
# only on image-related modifications
4+
# only on Dockerfile related modifications
55
on:
66
push:
77
branches:
@@ -12,6 +12,7 @@ on:
1212
- "hashicorp.asc"
1313
- "tests/**"
1414
- ".dockerignore"
15+
- "hadolint.yaml"
1516
- ".github/workflows/push-latest.yml"
1617

1718
env:

Dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Setup build arguments with default versions
22
ARG AWS_CLI_VERSION
33
ARG TERRAFORM_VERSION
4-
ARG PYTHON_MAJOR_VERSION=3.7
5-
ARG DEBIAN_VERSION=buster-20210511-slim
4+
ARG PYTHON_MAJOR_VERSION=3.9
5+
ARG DEBIAN_VERSION=bullseye-20210902-slim
66

77
# Download Terraform binary
88
FROM debian:${DEBIAN_VERSION} as terraform
99
ARG TERRAFORM_VERSION
1010
RUN apt-get update
11-
RUN apt-get install --no-install-recommends -y curl=7.64.0-4+deb10u2
12-
RUN apt-get install --no-install-recommends -y ca-certificates=20200601~deb10u2
13-
RUN apt-get install --no-install-recommends -y unzip=6.0-23+deb10u2
14-
RUN apt-get install --no-install-recommends -y gnupg=2.2.12-1+deb10u1
11+
RUN apt-get install --no-install-recommends -y curl=7.74.0-1.3+b1
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
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,9 +28,9 @@ FROM debian:${DEBIAN_VERSION} as aws-cli
2828
ARG AWS_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}.3-1
32-
RUN apt-get install -y --no-install-recommends python3-pip=18.1-5
33-
RUN pip3 install --no-cache-dir setuptools==57.0.0
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==58.0.4
3434
RUN pip3 install --no-cache-dir awscli==${AWS_CLI_VERSION}
3535

3636
# Build final image
@@ -39,10 +39,10 @@ LABEL maintainer="bgauduch@github"
3939
ARG PYTHON_MAJOR_VERSION
4040
RUN apt-get update \
4141
&& apt-get install -y --no-install-recommends \
42-
ca-certificates=20200601~deb10u2 \
43-
git=1:2.20.1-2+deb10u3 \
44-
jq=1.5+dfsg-2+b1 \
45-
python3=${PYTHON_MAJOR_VERSION}.3-1 \
42+
ca-certificates=20210119\
43+
git=1:2.30.2-1 \
44+
jq=1.6-2.1 \
45+
python3=${PYTHON_MAJOR_VERSION}.2-3 \
4646
&& apt-get clean \
4747
&& rm -rf /var/lib/apt/lists/* \
4848
&& update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_MAJOR_VERSION} 1

README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
[![build-test](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/build-test.yml/badge.svg)](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/build-test.yml)
33
[![push-latest](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/push-latest.yml/badge.svg)](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/push-latest.yml)
44
[![release](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/release.yml/badge.svg)](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/release.yml)
5-
[![dockerhub-description-update](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/dockerhub-description-update.yml/badge.svg)](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/dockerhub-description-update.yml)
65

6+
[![dockerhub-description-update](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/dockerhub-description-update.yml/badge.svg)](https://github.com/zenika-open-source/terraform-aws-cli/actions/workflows/dockerhub-description-update.yml)
77
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
88
[![Docker Pulls](https://img.shields.io/docker/pulls/zenika/terraform-aws-cli.svg)](https://hub.docker.com/r/zenika/terraform-aws-cli/)
99

@@ -16,11 +16,11 @@ Supported versions are listed in the [`supported_versions.json`](https://github.
1616

1717
The following image tag strategy is applied:
1818
* `zenika/terraform-aws-cli:latest` - build from master
19-
* Included CLI versions are the newest in the [`supported_versions.json` ](https://github.com/Zenika/terraform-aws-cli/blob/master/supported_versions.json) file.<>
19+
* Included CLI versions are the newest in the [`supported_versions.json` ](https://github.com/Zenika/terraform-aws-cli/blob/master/supported_versions.json) file.
2020
* `zenika/terraform-aws-cli:release-S.T_terraform-UU.VV.WW_awscli-XX.YY.ZZ` - build from releases
2121
* `release-S.T` is the release tag
22-
* `terraform-UU.VV.WWW` is the Terraform version included in the image
23-
* `awscli-XX.YY.ZZ` is the AWS CLI version included in the image
22+
* `terraform-UU.VV.WWW` is the **Terraform** version included in the image
23+
* `awscli-XX.YY.ZZ` is the **AWS CLI** version included in the image
2424

2525
Please report to the [releases page](https://github.com/Zenika/terraform-aws-cli/releases) for the changelogs.
2626

@@ -34,14 +34,11 @@ This image gives you the flexibility to be used for development or as a base ima
3434
## 🔧 What's inside ?
3535
Tools included:
3636

37-
* [AWS CLI](https://aws.amazon.com/fr/cli/)
38-
* Included version indicated in the image tag: `awscli-XX.YY.ZZ`
3937
* [Terraform CLI](https://www.terraform.io/docs/commands/index.html)
40-
* Included version indicated in the image tag: `terraform-XX.YY.ZZ`
41-
* See available versions on the [project release page](https://github.com/hashicorp/terraform/releases)
42-
* [Git](https://git-scm.com/) for Terraform remote module usage, see available versions on the [Debian Packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=git)
38+
* [AWS CLI](https://aws.amazon.com/fr/cli/)
39+
* [Git](https://git-scm.com/) for Terraform remote module usage
4340
* [Python 3](https://www.python.org/)
44-
* [jq](https://stedolan.github.io/jq/) to process JSON returned by AWS, see available versions on the [Debian Packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=jq)
41+
* [jq](https://stedolan.github.io/jq/) to process JSON returned by AWS
4542
* This image uses a non-root user with a UID and GID of 1001 to conform with docker security best practices.
4643

4744
## 🚀 Usage
@@ -69,7 +66,7 @@ It will :
6966

7067
```bash
7168
# launch build script
72-
./build.sh
69+
./dev.sh
7370
```
7471

7572
Optionally, it is possible to choose the tools desired versions :
@@ -80,7 +77,7 @@ AWS_CLI_VERSION=1.18.189
8077
TERRAFORM_VERSION=0.14.0
8178

8279
# launch the build script with parameters
83-
./build.sh $AWS_CLI_VERSION $TERRAFORM_VERSION
80+
./dev.sh $AWS_CLI_VERSION $TERRAFORM_VERSION
8481
```
8582

8683
## 🙏 Contributions
@@ -89,20 +86,21 @@ Do not hesitate to contribute by [filling an issue](https://github.com/Zenika/te
8986
## ⬆️ Dependencies upgrades checklist
9087

9188
* Supported versions:
92-
* check AWS CLI version, available on the [project release page](https://github.com/aws/aws-cli/releases)
93-
* check Terraform CLI version (keep all minor versions from 0.11), available on the [project release page](https://github.com/hashicorp/terraform/releases)
89+
* check available **AWS CLI** version on the [project release page](https://github.com/aws/aws-cli/releases)
90+
* check available **Terraform CLI** version (keep all minor versions from 0.11) available on the [project release page](https://github.com/hashicorp/terraform/releases)
9491
* Dockerfile:
95-
* check base image version on DockerHub
92+
* check **base image** version on DockerHub
9693
* check OS package versions on Debian package repository
97-
* Available Git versions on the [Debian Packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=git)
98-
* Available Python versions on the [Debian packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=python3)
94+
* Available **Git** versions on the [Debian Packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=git)
95+
* Available **Python** versions on the [Debian packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=python3)
96+
* Available **JQ** versions on the [Debian Packages repository](https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=jq)
9997
* same process for all other packages
100-
* check Pip package versions on [pypi](https://pypi.org/)
98+
* check **Pip** package versions on [pypi](https://pypi.org/)
10199
* Github actions:
102100
* check [runner version](https://github.com/actions/virtual-environments#available-environments)
103-
* check each action release versions
101+
* check **each action release** versions
104102
* Build scripts:
105-
* check container tags:
103+
* check **container tags**:
106104
* [Hadolint releases](https://github.com/hadolint/hadolint/releases)
107105
* [Container-structure-test](https://github.com/GoogleContainerTools/container-structure-test/releases)
108106
* Readme:

build.sh renamed to dev.sh

File renamed without changes.

supported_versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"0.13.7",
66
"0.14.11",
77
"0.15.5",
8-
"1.0.0"
8+
"1.0.6"
99
],
1010
"awscli_version": [
11-
"1.19.95"
11+
"1.20.41"
1212
]
1313
}

tests/container-structure-tests.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

tests/container-structure-tests.yml.template

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

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

2121
- name: "Check JQ version"
2222
command: "jq"
2323
args: ["--version"]
24-
expectedOutput: ["jq-1.5"]
24+
expectedOutput: ["jq-1.6"]
2525

2626
- name: "Check Terraform CLI version"
2727
command: "terraform"

0 commit comments

Comments
 (0)