1

[UPDATE]

The error comes from a build container that houses a docker version that was changed. Upgrading that docker version solved the problem. So in a way this gitlab/runner: manifest for moby/buildkit:buildx-stable-1 not found was the correct answer, our attempts to update must have been at the wrong place.

Problem:

I'm trying to run docker build and publish to an elastic container registry in AWS using jenkins. Without changing the jenkinsfile or the dockerfiles, the builds have now started to fail. The last successful build ran on January 26, 2023.

Jenkinsfile:

// ...irrelevant stuff...

    def customImage = docker.build("xxxx-builder:latest", "--build-arg BUILDENV=${buildenv} --network=host .")

        customImage.inside("-u 0:0 -e HOME='/tmp' --privileged --network=host -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/NuGetScratch/ -v /tmp/.nuget") {
            sh "docker system prune -f"
            sh "dotnet lambda deploy-function -cfg aws-lambda-tools-${awsservice}.json --aws-access-key-id ${creds[0]} --aws-secret-key ${creds[1]}"
            sh "chown -R jenkins-SAWSMGT:jenkins-SAWSMGT ./"
        }

Dockerfile:

FROM mcr.microsoft.com/dotnet/sdk:5.0

# Required build arguments
ARG BUILDENV

# Environment variables
ENV BUILDENV ${BUILDENV}
ENV PATH="${PATH}:/tmp/.dotnet/tools"
VOLUME /home/jenkins-SAWSMGT

# Install dependencies
RUN apt update && \
    apt install -y \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg2 \
        software-properties-common && \
    apt-key adv --fetch-keys https://download.docker.com/linux/debian/gpg && \
    add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" && \
    apt update && \
    apt install -y zip docker-ce docker-ce-cli containerd.io && \
    rm -rf /var/lib/apt/lists/* && \
    apt clean && \
    apt autoremove -y

# Change user
RUN groupadd -r -g 1015 jenkins-SAWSMGT
RUN useradd -r -u 1014 -g jenkins-SAWSMGT jenkins-SAWSMGT
USER root

# Install AWS Lambda Toolkit
ENV HOME="/tmp"
RUN dotnet tool install -g Amazon.Lambda.Tools

Dockerfile2:

FROM public.ecr.aws/lambda/dotnet:5.0

WORKDIR /var/task

COPY "bin/Release/net5.0/linux-x64/publish"  .

RUN yum install -y amazon-linux-extras
RUN amazon-linux-extras install epel -y
RUN yum install -y \
    libgdiplus \
    libjpeg \
    rpmdevtools \
    wget \
    yum-utils
ENV WKHTMLTOPDF_BIN="wkhtmltopdf.rpm"
RUN wget -O $WKHTMLTOPDF_BIN https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.$(arch).rpm \
    && yum install -y $WKHTMLTOPDF_BIN

RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf
RUN mkdir -p /var/lang/lib && cp -fvr /usr/local/lib/* /var/lang/lib/

Output of the failing build:

......... 

Inspecting Dockerfile to figure how to build project and docker image
Executing docker build
... invoking 'docker build', working folder '/data00/jenkins-slaves/SAWSMGT/workspace/XXXX, docker file /data00/jenkins-slaves/SAWSMGT/workspace/XXXX/Dockerfile2, image name xxxx:dev'
... docker build  -f "/data00/jenkins-slaves/SAWSMGT/workspace/XXXX/Dockerfile2" -t xxxx:dev --network=host .
... docker build: #1 [internal] booting buildkit
... docker build: #1 pulling image moby/buildkit:buildx-stable-1
... docker build: #1 pulling image moby/buildkit:buildx-stable-1 1.4s done
... docker build: #1 creating container buildx_buildkit_default 0.0s done
... docker build: #1 ERROR: Error response from daemon: No such image: moby/buildkit:buildx-stable-1
... docker build: ------
... docker build:  > [internal] booting buildkit:
... docker build: ------
... docker build: WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
... docker build: ERROR: Error response from daemon: No such image: moby/buildkit:buildx-stable-1
Error executing "docker build"
Error executing "docker build"

I've tried to change the .NET version to both newer and older versions, tried adding --load or --push as build options with no success.

Any ideas???

  • Does this answer your question? [gitlab/runner: manifest for moby/buildkit:buildx-stable-1 not found](https://stackoverflow.com/questions/75359458/gitlab-runner-manifest-for-moby-buildkitbuildx-stable-1-not-found) – erik258 Mar 01 '23 at 15:38
  • Unfortunately not! But it seems like a build was able to go through by replacing the linux version in add-apt-repository from "buster" to "stretch". However, it feels inconvenient to switch to an outdated version of linux. – brorlarsnicklas Mar 02 '23 at 06:52

1 Answers1

4

fix it on my centos 7.x by upgrading docker version

$ yum remove docker \
  docker-client \
  docker-client-latest \
  docker-common \
  docker-latest \
  docker-latest-logrotate \
  docker-logrotate \
  docker-engine
$ yum install -y yum-utils
$ yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
$ yum install docker-ce docker-ce-cli containerd.io
$ systemctl start docker
$ systemctl enable docker
l2m2
  • 402
  • 3
  • 9