Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add python3, update dependencies, update documentation #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ARG AWS_CLI_VERSION
ARG TERRAFORM_VERSION
ARG DEBIAN_VERSION=bookworm-20231120-slim
ARG DEBIAN_FRONTEND=noninteractive
ARG PYTHON_MAJOR_VERSION=3.11

# Download Terraform binary
FROM debian:${DEBIAN_VERSION} as terraform
Expand All @@ -11,7 +12,7 @@ ARG TERRAFORM_VERSION
RUN apt-get update
# RUN apt-get install --no-install-recommends -y libcurl4=7.74.0-1.3+deb11u7
RUN apt-get install --no-install-recommends -y ca-certificates=20230311
RUN apt-get install --no-install-recommends -y curl=7.88.1-10+deb12u4
RUN apt-get install --no-install-recommends -y curl=7.88.1-10+deb12u5
RUN apt-get install --no-install-recommends -y gnupg=2.2.40-1.1
RUN apt-get install --no-install-recommends -y unzip=6.0-28
WORKDIR /workspace
Expand All @@ -28,7 +29,7 @@ FROM debian:${DEBIAN_VERSION} as aws-cli
ARG AWS_CLI_VERSION
RUN apt-get update
RUN apt-get install -y --no-install-recommends ca-certificates=20230311
RUN apt-get install -y --no-install-recommends curl=7.88.1-10+deb12u4
RUN apt-get install --no-install-recommends -y curl=7.88.1-10+deb12u5
RUN apt-get install -y --no-install-recommends gnupg=2.2.40-1.1
RUN apt-get install -y --no-install-recommends unzip=6.0-28
RUN apt-get install -y --no-install-recommends git=1:2.39.2-1.1
Expand All @@ -45,14 +46,17 @@ RUN ./aws/install --install-dir /usr/local/aws-cli --bin-dir /usr/local/bin
# Build final image
FROM debian:${DEBIAN_VERSION} as build
LABEL maintainer="bgauduch@github"
ARG PYTHON_MAJOR_VERSION
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates=20230311\
git=1:2.39.2-1.1 \
jq=1.6-2.1 \
openssh-client=1:9.2p1-2+deb12u1 \
python3=${PYTHON_MAJOR_VERSION}.2-1+b1 \
openssh-client=1:9.2p1-2+deb12u2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_MAJOR_VERSION} 1
WORKDIR /workspace
COPY --from=terraform /workspace/terraform /usr/local/bin/terraform
COPY --from=aws-cli /usr/local/bin/ /usr/local/bin/
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Tools included:
* [AWS CLI](https://aws.amazon.com/fr/cli/)
* [Git](https://git-scm.com/) for Terraform remote module usage
* [jq](https://stedolan.github.io/jq/) to process JSON returned by AWS
* [Python 3](https://www.python.org/)
* [OpenSSH Client](https://www.openssh.com/) to handle Terraform module clone over SSH
* This image uses a non-root user with a UID and GID of 1001 to conform with docker security best practices.

Expand Down Expand Up @@ -88,6 +89,7 @@ TERRAFORM_VERSION=1.5.2
```

## 🙏 Contributions

Do not hesitate to contribute by [filling an issue](https://github.com/Zenika/terraform-aws-cli/issues) or [a PR](https://github.com/Zenika/terraform-aws-cli/pulls) !

## 📚 Documentations
Expand All @@ -100,6 +102,7 @@ Do not hesitate to contribute by [filling an issue](https://github.com/Zenika/te
* For Azure: [zenika-open-source/terraform-azure-cli](https://github.com/zenika-open-source/terraform-azure-cli)

## 📖 License

This project is under the [Apache License 2.0](https://raw.githubusercontent.com/Zenika/terraform-aws-cli/master/LICENSE)

[![with love by zenika](https://img.shields.io/badge/With%20%E2%9D%A4%EF%B8%8F%20by-Zenika-b51432.svg)](https://oss.zenika.com)
8 changes: 5 additions & 3 deletions docs/dependencies-upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
* check available **AWS CLI** version on the [project release page](https://github.com/aws/aws-cli/tags)
* check available **Terraform CLI** version (keep all minor versions from 0.11) on the [project release page](https://github.com/hashicorp/terraform/releases)
* Dockerfile:
* check **base image** version [on DockerHub](https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye)
* check **base image** version [on DockerHub](https://hub.docker.com/_/debian?tab=tags&page=1&name=bookworm)
* check OS package versions on Debian package repository
* Available **Git** versions on the [Debian Packages repository](https://packages.debian.org/search?suite=bullseye&arch=any&searchon=names&keywords=git)
* Available **JQ** versions on the [Debian Packages repository](https://packages.debian.org/search?suite=bullseye&arch=any&searchon=names&keywords=jq)
* Available **Git** versions on the [Debian Packages repository](https://packages.debian.org/search?suite=bookworm&arch=any&searchon=names&keywords=git)
* Available **Python** versions on the [Debian packages repository](https://packages.debian.org/search?suite=bookworm&arch=any&searchon=names&keywords=python3)
* Available **JQ** versions on the [Debian Packages repository](https://packages.debian.org/search?suite=bookworm&arch=any&searchon=names&keywords=jq)
* same process for all other packages
* check **Pip** package versions on [pypi](https://pypi.org/)
* Dockerfile tests : update version according to changes in Dockerfile in [tests/container-structure-tests.yml.template](tests/container-structure-tests.yml.template)
* Github actions:
* check [runner version](https://github.com/actions/virtual-environments#available-environments)
Expand Down
5 changes: 5 additions & 0 deletions tests/container-structure-tests.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ metadataTest:
workdir: "/workspace"

commandTests:
- name: "Check Python version"
command: "python"
args: ["--version"]
expectedOutput: ["Python 3.11.2"]

- name: "Check Git version"
command: "git"
args: ["--version"]
Expand Down