Skip to content

Commit a22b35f

Browse files
committed
feat(imagebuilder): use official podman
1 parent bb2040e commit a22b35f

5 files changed

Lines changed: 33 additions & 14 deletions

File tree

charts/imagebuilder/templates/imagebuilder-configmap.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,5 @@ data:
1717
}
1818
]
1919
registries.conf: |
20-
unqualified-search-registries = ["docker.io", "quay.io"]
21-
[[registry]]
22-
prefix = "docker.io"
23-
insecure = true
24-
[[registry]]
25-
prefix = "localhost:5000"
26-
insecure = true
20+
{{- .Values.container_registries | nindent 4 }}
2721
image_pull_policy: {{ .Values.image_pull_policy }}

charts/imagebuilder/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ image_org: "drycc"
22
image_pull_policy: "Always"
33
image_tag: "canary"
44
image_registry: "docker.io"
5+
container_registries: |
6+
unqualified-search-registries = ["docker.io"]
7+
short-name-mode="permissive"

rootfs/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
FROM docker.io/minio/mc:latest as mc
2+
FROM docker.io/drycc/go-dev:latest as go-dev
23

3-
FROM docker.io/drycc/go-dev
4+
FROM quay.io/containers/podman:latest
45

56
ADD . /
67
COPY --from=mc /usr/bin/mc /bin/mc
8+
COPY --from=go-dev /usr/local/bin/pack /bin/pack
79

810
RUN /imagebuilder/install
911

rootfs/imagebuilder/build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ if [[ "${DRYCC_DEBUG}" ]]; then
3838
unset DRYCC_DEBUG
3939
fi
4040

41+
registries="/etc/imagebuilder/registries.conf"
42+
if [ -f "${registries}" ]; then
43+
cat "${registries}" > /etc/containers/registries.conf
44+
fi
45+
4146
podman system service \
4247
--log-level "${log_level}" \
4348
--time 0 tcp:0.0.0.0:${DOCKER_PORT} &

rootfs/imagebuilder/install

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
#!/usr/bin/env bash
22
set -eo pipefail
33

4-
CADDY_DOWNLOAD_URL="https://github.com/caddyserver/caddy/releases/download/v2.4.3/caddy_2.4.3_linux_$(dpkg --print-architecture).tar.gz"
4+
# initArch discovers the architecture for this system.
5+
init_arch() {
6+
ARCH=$(uname -m)
7+
case $ARCH in
8+
armv5*) ARCH="armv5";;
9+
armv6*) ARCH="armv6";;
10+
armv7*) ARCH="arm";;
11+
aarch64) ARCH="arm64";;
12+
x86) ARCH="386";;
13+
x86_64) ARCH="amd64";;
14+
i686) ARCH="386";;
15+
i386) ARCH="386";;
16+
esac
17+
}
18+
init_arch
19+
20+
CADDY_DOWNLOAD_URL="https://github.com/caddyserver/caddy/releases/download/v2.4.5/caddy_2.4.5_linux_${ARCH}.tar.gz"
521
(curl -sSL "${CADDY_DOWNLOAD_URL}" | tar -C /usr/local/bin/ --no-same-owner -xzv caddy)
622

7-
apt-get autoremove -y --purge
8-
apt-get clean all
23+
dnf install -yq procps-ng psmisc
24+
25+
dnf clean all
926
rm -rf /root/*
10-
rm -rf /tmp/*
11-
rm -rf /var/cache/apt/archives/*.deb
12-
rm -rf /var/lib/apt/lists/*
27+
rm -rf /tmp/*

0 commit comments

Comments
 (0)