Skip to content

Commit d8d1a21

Browse files
committed
Added Ansible; upgraded Python to 3.13, Go to 1.23
1 parent 6b9603d commit d8d1a21

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
22
NOTES
33
*.log
4-
slim.report.json
4+
slim.*.json
5+
dive.*.json

Dockerfile

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ echo "::group::Install common build tools"
1414
echo "::endgroup::"
1515
EOT
1616

17-
# build Python 3.12: https://www.build-python-from-source.com/
17+
# build Python 3.13: https://www.build-python-from-source.com/
1818
RUN <<'EOT'
1919
set -e
20-
echo "::group::Build Python 3.12"
20+
echo "::group::Build Python 3.13"
2121
( set -uxo pipefail
2222

2323
cd /tmp
2424
dnf install -y openssl-devel bzip2-devel xz-devel libffi-devel \
2525
libuuid-devel gdbm-devel readline-devel tk-devel sqlite-devel
26-
VER="3.12"
26+
VER="3.13"
2727
FTP="https://www.python.org/ftp/python"
2828
# determine the latest patch version
2929
ver=$(curl -s $FTP/ | sed -En 's/^.+href="('${VER/./\\.}'\..+)\/".+$/\1/p' | sort -Vr | head -1)
@@ -199,7 +199,7 @@ FROM public.ecr.aws/amazonlinux/amazonlinux:2023 AS final
199199
# =======================================================
200200

201201
#LABEL name="al2023-devops"
202-
#LABEL description="Amazon Linux 2023 with Python 3.12, Go 1.22, Node.js 22, AWS CLI, Mountpoint for S3, CDK, CDK8s, Docker, Kubectl, Krew, Helm, Argo CD, and utilities like jq, jo, yq, jsonnet, and Just"
202+
#LABEL description="Amazon Linux 2023 with Python 3.13, Go 1.23, Node.js 22, AWS CLI, Mountpoint for S3, CDK, CDK8s, Docker, Kubectl, Krew, Helm, Argo CD, and utilities like jq, jo, yq, jsonnet, and Just"
203203
#LABEL maintainer="[email protected]"
204204

205205
ENV TERM="xterm-256color"
@@ -229,8 +229,8 @@ echo "::group::Install Linux utilities"
229229
# install common utilities (procps provides "free" command)
230230
# perl-IPC-Run and perl-Time-HiRes are required by moreutils
231231
dnf install -y git wget tar xz bzip2 gzip unzip man bash-completion \
232-
which findutils pwgen gettext procps openssl nmap tmux vim bc \
233-
glibc-locale-source glibc-langpack-en perl-IPC-Run perl-Time-HiRes
232+
which findutils pwgen gettext procps sshpass openssl nmap tmux vim \
233+
bc glibc-locale-source glibc-langpack-en perl-IPC-Run perl-Time-HiRes
234234
dnf clean all
235235
rm -rf /var/log/* /var/cache/dnf
236236
alternatives --install /usr/local/bin/vi vi /usr/bin/vim 1
@@ -308,19 +308,19 @@ echo "::group::Install Python tools"
308308
# /usr/local/poetry/bin is already in $PATH via Dockerfile ENV command
309309
poetry -V
310310

311-
# install pipx, Pygments and ansitable
312-
pip3 install --no-cache-dir --root-user-action=ignore pipx pygments colored ansitable
311+
# install pipx, Pygments, ansitable, and Ansible
312+
pip3 install --no-cache-dir --root-user-action=ignore pipx pygments colored ansitable ansible
313313
pipx ensurepath --global && pipx --version
314314
rm -rf /root/.cache
315315
pygmentize -V
316316
)
317317
echo "::endgroup::"
318318
EOT
319319

320-
# install Golang 1.22
320+
# install Golang 1.23
321321
RUN <<'EOT'
322322
set -e
323-
echo "::group::Install Golang 1.22"
323+
echo "::group::Install Golang 1.23"
324324
( set -uxo pipefail
325325

326326
dnf install -y golang

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Multi-arch (x86_64/amd64 and aarch64/arm64) Docker image based on **Amazon Linux
55
## Bundled Tools
66

77
Includes the following components:
8-
- [Python 3.12](https://www.python.org/downloads)
9-
- [Go 1.22](https://go.dev/dl)
8+
- [Python 3.13](https://www.python.org/downloads)
9+
- [Go 1.23](https://go.dev/dl)
1010
- [Node.js 22](https://nodejs.org/en/download)
1111
- [Poetry](https://python-poetry.org/)
1212
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide)
@@ -28,6 +28,7 @@ Includes the following components:
2828
- [helm-ssm](https://github.com/codacy/helm-ssm)
2929
- [Helmfile](https://github.com/helmfile/helmfile)
3030
- [Argo CD](https://argo-cd.readthedocs.io/en/stable/)
31+
- [Ansible](https://docs.ansible.com/)
3132

3233
As well as the following utilities:
3334
- [jq](https://stedolan.github.io/jq), [jo](https://github.com/jpmens/jo), and [yq](https://mikefarah.gitbook.io/yq)
@@ -41,7 +42,7 @@ As well as the following utilities:
4142

4243
## Prebuilt Images
4344

44-
Size is approximately 3 GB.
45+
Size is approximately 3 GB _(too chubby, I know — see the [To-Do](#to-do) section)._
4546

4647
Images are available in the following repositories:
4748
- Docker Hub: [`docker.io/erhhung/al2023-devops`](https://hub.docker.com/repository/docker/erhhung/al2023-devops)
@@ -51,5 +52,4 @@ Version information about the installed components can be found inside the Docke
5152

5253
## To-Do
5354

54-
The current "All-in-One" image is getting bloated, so there's a need to create a slimmed-down image for
55-
CI/CD pipelines only, and a separate image for launching ad-hoc containers for manual administration.
55+
The current "All-in-One" image is getting too bloated, so there's a need to create specialized versions, like a slimmed-down image just for CI/CD pipelines, and a separate image for launching ad-hoc containers for manual administration and debugging. It's also unlikely that a single CI/CD pipeline stage would need all language environments, as Python and Go are especially chubby.

config/.bash_profile

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ alias l='less'
1111
alias k='kubectl'
1212
alias kg='kubectl-grep'
1313
alias ar='kubectl-argo-rollouts'
14+
alias ap='ansible-playbook'
1415
alias a='argocd'
1516
alias h='helm'
1617

scripts/versions.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ gclone() {
3232

3333
# <repository>
3434
grelease() {
35-
curl -Is $1/releases/latest | sed -En 's/^location:.+\/tag\/(.+)\r$/\1/p'
35+
curl -Is "$1/releases/latest" | sed -En 's/^location:.+\/tag\/(.+)\r$/\1/p'
3636
}
3737

38+
setver ansible $(v=(`ansible --version | head -1`); echo ${v[-1]%\]})
3839
setver argocd $(v=(`argocd version --client --short`); v=${v[-1]#v}; echo ${v%+*})
3940
setver aws $(v=(`aws --version`); echo ${v[0]#*/})
4041
setver bash ${BASH_VERSION/%\(*/}
@@ -84,7 +85,8 @@ setver poetry $(v=(`poetry --version`); echo ${v[2]%)})
8485
setver pwgen $(dnfver pwgen)
8586
setver pygments $(v=(`pygmentize -V`); echo ${v[2]%,})
8687
setver python $(v=(`python --version`); echo ${v[-1]})
87-
setver sops $(v=(`sops --version | head -1`); echo ${v[1]})
88+
setver sops $(v=(`sops --version | head -1`); echo ${v[-1]})
89+
setver sshpass $(v=(`sshpass -V | head -1`); echo ${v[-1]})
8890
setver tar $(v=(`tar --version | head -1`); echo ${v[-1]})
8991
setver tini $(v=(`tini --version`); echo ${v[2]})
9092
setver tmux $(v=(`tmux -V`); echo ${v[-1]})

0 commit comments

Comments
 (0)