-
Notifications
You must be signed in to change notification settings - Fork 274
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
Upgrade Base Image to Amazon Linux 2023 #1122
Changes from 5 commits
9cc368e
0a59a3b
2a72f01
883da24
6c6bd3e
25a9da8
23b3db8
6ca45e4
4f99405
2143bda
eca2fe2
3c57da5
9c0d053
2d32dfc
734e9ce
214f529
b8a23e1
e8e41a8
6ecfbf0
f12eed1
406d9ff
07a7a1b
6a7667c
198c8bc
96510d4
da56b78
b4be589
2e25e00
e1e9479
c0b6d97
d290926
7755a93
974b2b9
b4afa48
3e4cd66
00e7a8b
9272fb7
d0bb6f2
3c7c3a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are now systemd timers |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are now systemd timers |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Clean files used by docker except for the build cache | ||
Wants=docker-gc.timer | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/local/bin/docker-gc | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Clean files used by docker except for the build cache | ||
Requires=docker-gc.service | ||
|
||
[Timer] | ||
Unit=docker-gc.service | ||
OnCalendar=hourly | ||
|
||
[Install] | ||
WantedBy=timers.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Clean files used by docker including the build cache when disk space is low | ||
Wants=docker-low-disk-gc.timer | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/local/bin/docker-low-disk-gc | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Clean files used by docker including the build cache when disk space is low | ||
Requires=docker-low-disk-gc.service | ||
|
||
[Timer] | ||
Unit=docker-low-disk-gc.service | ||
OnCalendar=hourly | ||
|
||
[Install] | ||
WantedBy=timers.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ set -eu -o pipefail | |
|
||
DOCKER_VERSION=20.10.23 | ||
DOCKER_RELEASE="stable" | ||
DOCKER_COMPOSE_VERSION=1.29.2 | ||
DOCKER_COMPOSE_V2_VERSION=2.16.0 | ||
DOCKER_BUILDX_VERSION="0.10.5" | ||
MACHINE=$(uname -m) | ||
|
@@ -33,42 +32,18 @@ sudo curl -Lfs -o /etc/systemd/system/docker.socket "https://raw.githubuserconte | |
sudo systemctl daemon-reload | ||
sudo systemctl enable docker.service | ||
|
||
if [ "${MACHINE}" == "x86_64" ]; then | ||
echo "Downloading docker-compose..." | ||
sudo curl -Lsf -o /usr/bin/docker-compose https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 | ||
sudo chmod +x /usr/bin/docker-compose | ||
docker-compose --version | ||
elif [[ "${MACHINE}" == "aarch64" ]]; then | ||
sudo yum install -y gcc-c++ libffi-devel openssl11 openssl11-devel python3-devel | ||
|
||
# docker-compose depends on the cryptography package, v3.4 of which | ||
# introduces a build dependency on rust; let's avoid that for now. | ||
# https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst#34---2021-02-07 | ||
# This should be unpinned ASAP; hopefully docker-compose will offer binary | ||
# download for arm64 at some point: | ||
# https://github.com/docker/compose/issues/7472 | ||
CONSTRAINT_FILE="/tmp/docker-compose-pip-constraint" | ||
echo 'cryptography<3.4' >"$CONSTRAINT_FILE" | ||
echo 'urllib3<2' >"$CONSTRAINT_FILE" | ||
sudo pip3 install --constraint "$CONSTRAINT_FILE" "docker-compose==${DOCKER_COMPOSE_VERSION}" | ||
|
||
docker-compose version | ||
else | ||
echo "No docker compose option configured for arch ${MACHINE}" | ||
exit 1 | ||
fi | ||
|
||
Comment on lines
-36
to
-60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
echo "Adding docker cron tasks..." | ||
sudo cp /tmp/conf/docker/cron.hourly/docker-gc /etc/cron.hourly/docker-gc | ||
sudo cp /tmp/conf/docker/cron.hourly/docker-low-disk-gc /etc/cron.hourly/docker-low-disk-gc | ||
sudo chmod +x /etc/cron.hourly/docker-* | ||
echo "Adding docker systemd timers..." | ||
sudo cp /tmp/conf/docker/scripts/* /usr/local/bin | ||
sudo cp /tmp/conf/docker/systemd/docker-* /etc/systemd/system | ||
sudo chmod +x /usr/local/bin/docker-* | ||
sudo systemctl daemon-reload | ||
sudo systemctl enable docker-gc.timer docker-low-disk-gc.timer | ||
|
||
echo "Installing jq..." | ||
sudo yum install -y -q jq | ||
jq --version | ||
|
||
echo "Installing docker buildx..." | ||
|
||
DOCKER_CLI_DIR=/usr/libexec/docker/cli-plugins | ||
sudo mkdir -p "${DOCKER_CLI_DIR}" | ||
|
||
|
@@ -82,7 +57,6 @@ case "${MACHINE}" in | |
;; | ||
esac | ||
|
||
|
||
sudo curl --location --fail --silent --output "${DOCKER_CLI_DIR}/docker-buildx" "https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VERSION}/buildx-v${DOCKER_BUILDX_VERSION}.linux-${BUILDX_ARCH}" | ||
sudo chmod +x "${DOCKER_CLI_DIR}/docker-buildx" | ||
docker buildx version | ||
|
@@ -91,6 +65,9 @@ sudo curl --location --fail --silent --output "${DOCKER_CLI_DIR}/docker-compose" | |
sudo chmod +x "${DOCKER_CLI_DIR}/docker-compose" | ||
docker compose version | ||
|
||
sudo ln -s "${DOCKER_CLI_DIR}/docker-compose" /usr/bin/docker-compose | ||
docker-compose version | ||
|
||
echo "Installing qemu..." | ||
sudo yum install -y qemu qemu-user-static | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed