Workaround 'podman manifest' bug by including static docker as well.

This commit is contained in:
Thomas E Lackey 2024-02-23 11:20:30 -06:00
parent 1bbfbf399f
commit a39f2296da
3 changed files with 27 additions and 9 deletions

View File

@ -10,11 +10,6 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg -
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt update && apt install -y nodejs apt update && apt install -y nodejs
# kubectl
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/bin/kubectl
# laconic-so # laconic-so
RUN curl -LO https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/latest/laconic-so && \ RUN curl -LO https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/latest/laconic-so && \
chmod +x ./laconic-so && \ chmod +x ./laconic-so && \
@ -25,8 +20,16 @@ RUN npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm
npm install -g @cerc-io/laconic-registry-cli && \ npm install -g @cerc-io/laconic-registry-cli && \
npm install -g yarn npm install -g yarn
# symlink podman to docker # docker-static (needed because of a bug with 'podman manifest'
RUN ln -s $(which podman) $(dirname `which podman`)/docker ARG DOCKER_VER=25.0.3
WORKDIR /tmp
RUN curl -LO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz && \
tar zxvf docker-${DOCKER_VER}.tgz docker/docker && \
mv docker/docker /usr/local/bin/docker-static && \
rm -rf docker-${DOCKER_VER}.tgz docker
# Include our docker script.
COPY docker-wrapper.sh /usr/bin/docker
RUN mkdir -p /srv && mkdir -p /app RUN mkdir -p /srv && mkdir -p /app

15
docker-wrapper.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
PODMAN_BIN="/usr/bin/podman"
DOCKER_BIN="/usr/local/bin/docker-static"
if [[ "$1" == "manifest" ]]; then
$DOCKER_BIN $*
elif [[ "$1" == "login" ]]; then
$DOCKER_BIN $*
$PODMAN_BIN $*
else
$PODMAN_BIN $*
fi

4
run.sh
View File

@ -91,7 +91,7 @@ mount_program = "/usr/bin/fuse-overlayfs"
EOF EOF
if [[ -n "$IMAGE_REGISTRY_CREDS" ]]; then if [[ -n "$IMAGE_REGISTRY_CREDS" ]]; then
podman login --password "$IMAGE_REGISTRY_CREDS" --username ${IMAGE_REGISTRY_USER:-ANY} $IMAGE_REGISTRY docker login --password "$IMAGE_REGISTRY_CREDS" --username ${IMAGE_REGISTRY_USER:-ANY} $IMAGE_REGISTRY
fi fi
echo "Starting API" echo "Starting API"
@ -137,6 +137,6 @@ while true; do
--discover --discover
# Cleanup any build leftovers # Cleanup any build leftovers
podman system prune --all --force docker system prune --all --force
sleep 15 sleep 15
done done