Skip to content

Commit d6dd55f

Browse files
committed
updates for release 2024.03.03
1 parent 7ed2846 commit d6dd55f

12 files changed

Lines changed: 432 additions & 327 deletions

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
FROM ubuntu:23.10
1+
FROM ubuntu:24.04
22

33
WORKDIR /
44

55
COPY install install/
66

7-
RUN /bin/bash -c /install/install-packages.sh &&\
7+
# Avois "debconf: unable to initialize frontend: Dialog" errors
8+
ARG DEBIAN_FRONTEND=noninteractive
9+
10+
RUN /bin/bash -c /install/install-packages.sh && \
811
/bin/bash -c /install/collect-licenses.sh

Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
image_version := $(shell date "+%Y.%m.%d")
2-
image_name=devsecops-base
3-
docker_repo=msaginwm
2+
image_name = devsecops-base
3+
docker_repo = msaginwm
4+
docker_options = --progress=plain
45

6+
prune:
7+
docker image prune
8+
$(eval docker_options += --no-cache)
9+
510
build:
6-
docker build -t ${docker_repo}/${image_name}:${image_version} .
11+
docker build ${docker_options} -t ${docker_repo}/${image_name}:${image_version} .
12+
docker run ${docker_repo}/${image_name}:${image_version} cat /install/version.txt > version-info.txt
13+
docker run ${docker_repo}/${image_name}:${image_version} cat /install/packages.txt > packages-info.txt
14+
15+
rebuild: prune build
716

817
deploy:
918
docker tag ${docker_repo}/${image_name}:${image_version} ${docker_repo}/${image_name}:latest
@@ -12,10 +21,4 @@ deploy:
1221
run:
1322
docker run --interactive --tty ${docker_repo}/${image_name}:${image_version} /bin/bash
1423

15-
version-info:
16-
docker run ${docker_repo}/${image_name}:${image_version} cat /install/version.txt > version-info.txt
17-
18-
packages-info:
19-
docker run ${docker_repo}/${image_name}:${image_version} /bin/apt list --installed > packages-info.txt
20-
2124
all: build

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@
55

66
### Base image:
77
```
8-
Ubuntu (23.10)
8+
Ubuntu (24.04)
99
```
1010

1111
### Tools version:
1212
```
1313
[AWS CLI v2]
14-
aws-cli/2.12.6 Python/3.11.4 Linux/5.15.49-linuxkit-pr exe/x86_64.ubuntu.23 prompt/off
14+
aws-cli/2.15.25 Python/3.11.8 Linux/6.6.16-linuxkit exe/x86_64.ubuntu.24 prompt/off
1515
1616
[Docker]
17-
Docker version 24.0.2, build cb74dfc
17+
Docker version 25.0.3, build 4debf41
1818
1919
[kubectl]
2020
clientVersion:
21-
buildDate: "2023-06-14T09:53:42Z"
21+
buildDate: "2024-02-14T10:40:49Z"
2222
compiler: gc
23-
gitCommit: 25b4e43193bcda6c7328a6d147b1fb73a33f1598
23+
gitCommit: 4b8e819355d791d96b7e9d9efe4cbafae2311c88
2424
gitTreeState: clean
25-
gitVersion: v1.27.3
26-
goVersion: go1.20.5
25+
gitVersion: v1.29.2
26+
goVersion: go1.21.7
2727
major: "1"
28-
minor: "27"
28+
minor: "29"
2929
platform: linux/amd64
30-
kustomizeVersion: v5.0.1
30+
kustomizeVersion: v5.0.4-0.20230601165947-6ce0bf390ce3
3131
3232
[make]
3333
GNU Make 4.3
3434
3535
[Python]
36-
Python 3.11.4
36+
Python 3.12.2
3737
```
3838

3939
### Lincenses for components used in the image:
40-
* Ubuntu 23.04 - Ubuntu is an aggregate work of many works, each covered by their own licence(s) which are available under /usr/share/doc/PACKAGE/copyright.
40+
* Ubuntu 24.04 - Ubuntu is an aggregate work of many works, each covered by their own licence(s) which are available under /usr/share/doc/PACKAGE/copyright.
4141
* AWS CLI - Apache 2.0 - [LICENSE](https://github.com/aws/aws-cli/blob/v2/LICENSE.txt)
4242
* Docker - Apache 2.0 - [LICENSE](https://github.com/docker/docs/blob/main/LICENSE)
4343
* Kubernetes - Apache 2.0 - [LICENSE](https://github.com/kubernetes/k8s.io/blob/main/LICENSE)

install/install-packages.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
echo "################################"
33
echo "# DevSecOps base image builder #"
44
echo "################################"
55

66
# Update the apt package index
7-
apt update
8-
apt list --upgradable
7+
apt-get update
98
# Upgrade existing packages
10-
apt upgrade
9+
apt-get upgrade
10+
apt-get install -y \
11+
apt-utils
1112

1213
# Install additional packages
13-
for f in /install/packages/*.sh; do
14+
files=$(find /install/packages -type f -iname "*.sh" | sort)
15+
16+
for f in $files; do
17+
echo ">>> Installing [$f]..."
1418
bash "$f" || exit -1 # execute successfully or break
19+
echo ">>> Installing [$f] done."
1520
done
16-
21+
22+
# Print installed packages
23+
echo "Printing installed packages to file..."
24+
apt list --installed >> /install/packages.txt
25+
echo "Done."
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Install Python and its dev packages
4-
apt install -y \
4+
apt-get install -y \
55
python3 \
66
python3-dev \
77
python3-venv

install/packages/aws-cli-v2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Install dependencies
4-
apt install -y \
4+
apt-get install -y \
55
curl \
66
unzip
77

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
# Uninstall old Docker versions (if any)
4+
#apt-get remove docker docker-engine docker.io containerd runc
5+
6+
# create temp folder
7+
tempFolder=/tmp/install-docker
8+
mkdir ${tempFolder}
9+
cd ${tempFolder}
10+
11+
# Install dependencies
12+
apt-get install -y \
13+
ca-certificates \
14+
curl \
15+
gnupg
16+
17+
# Add Docker’s official GPG key
18+
mkdir -m 0755 -p /etc/apt/keyrings
19+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
20+
21+
# Set up the repository
22+
versionCodeName=$(. /etc/os-release && echo "$VERSION_CODENAME")
23+
echo "Host version code name is '${versionCodeName}'" > ${tempFolder}/host-version-codename.log
24+
# Ubuntu 23.10 "mantic" version is not yet released from docker: falling back to Ubuntu 23.04 "lunar"
25+
if [ "${versionCodeName}" == "mantic" ]; then
26+
versionCodeName=lunar
27+
else
28+
echo "Target distro is '${versionCodeName}'" > ${tempFolder}/target-distro.log
29+
fi
30+
echo \
31+
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
32+
"${versionCodeName}" stable" | \
33+
tee /etc/apt/sources.list.d/docker.list > ${tempFolder}/docker.list.log
34+
35+
# Update the apt package index
36+
apt-get update
37+
38+
# Install Docker Engine, containerd, and Docker Compose
39+
apt-get install -y \
40+
docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
41+
42+
# Verify that the installation is successful
43+
echo "[Docker]" >> /install/version.txt
44+
docker --version >> /install/version.txt
45+
echo "" >> /install/version.txt
46+
47+
# Cleanup temp folders
48+
rm -rf ${tempFolder}

install/packages/docker.sh

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
# Uninstall old Docker versions (if any)
4-
#apt-get remove docker docker-engine docker.io containerd runc
3+
# Install latest docker packages for Ubuntu 24.04
4+
# credits: https://kifarunix.com/how-to-install-docker-on-ubuntu-24-04/?expand_article=1#docker-repos
55

66
# create temp folder
77
tempFolder=/tmp/install-docker
@@ -10,34 +10,28 @@ cd ${tempFolder}
1010

1111
# Install dependencies
1212
apt-get install -y \
13-
ca-certificates \
14-
curl \
15-
gnupg
13+
apt-transport-https \
14+
ca-certificates \
15+
curl \
16+
gnupg-agent \
17+
software-properties-common
1618

1719
# Add Docker’s official GPG key
1820
mkdir -m 0755 -p /etc/apt/keyrings
19-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
20-
21-
# Set up the repository
22-
versionCodeName=$(. /etc/os-release && echo "$VERSION_CODENAME")
23-
echo "Host version code name is '${versionCodeName}'" > ${tempFolder}/host-version-codename.log
24-
# Ubuntu 23.10 "mantic" version is not yet released from docker: falling back to Ubuntu 23.04 "lunar"
25-
if [ "${versionCodeName}" == "mantic" ]; then
26-
versionCodeName=lunar
27-
else
28-
echo "Target distro is '${versionCodeName}'" > ${tempFolder}/target-distro.log
29-
fi
30-
echo \
31-
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
32-
"${versionCodeName}" stable" | \
33-
tee /etc/apt/sources.list.d/docker.list > ${tempFolder}/docker.list.log
21+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg
22+
23+
# Note that as of this writing, Docker-CE repos is not yet available for Ubuntu 24.04 Noble Numbat.
24+
# We will use Docker repos for Ubuntu 22.04 Jammy for now. However, if you want, you can install the
25+
# Docker packages that ships with Ubuntu 24.04 by default, docker.io. This may not provide the latest
26+
# release versions of Docker though.
27+
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable" | tee /etc/apt/sources.list.d/docker-ce.list
3428

3529
# Update the apt package index
3630
apt-get update
3731

3832
# Install Docker Engine, containerd, and Docker Compose
3933
apt-get install -y \
40-
docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
34+
docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
4135

4236
# Verify that the installation is successful
4337
echo "[Docker]" >> /install/version.txt

install/packages/kubectl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Install dependencies
4-
apt install -y \
4+
apt-get install -y \
55
curl
66

77
# create temp folder

install/packages/make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
apt install -y \
3+
apt-get install -y \
44
make
55

66
echo "[make]" >> /install/version.txt

0 commit comments

Comments
 (0)