From 669ad1f7ebe92370d1c6852679ed9aa8e1dd88a8 Mon Sep 17 00:00:00 2001 From: davidko Date: Mon, 17 Jun 2024 18:58:04 +0800 Subject: [PATCH 1/2] ci: use golang bci instead of manual download Signed-off-by: davidko (cherry picked from commit d1662b28859b0158ffe674bb620897cc0f4f0f5f) # Conflicts: # Dockerfile.dapper --- Dockerfile.dapper | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 6d600027..23a7a9e8 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -1,21 +1,28 @@ +<<<<<<< HEAD FROM registry.suse.com/bci/bci-base:15.5 +======= +FROM registry.suse.com/bci/golang:1.22 +>>>>>>> d1662b2 (ci: use golang bci instead of manual download) -ARG DAPPER_HOST_ARCH=amd64 +ARG DAPPER_HOST_ARCH ARG http_proxy ARG https_proxy -ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} -# Setup environment +ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} ENV PATH /go/bin:$PATH ENV DAPPER_DOCKER_SOCKET true ENV DAPPER_ENV TAG REPO DRONE_REPO DRONE_PULL_REQUEST DRONE_COMMIT_REF ENV DAPPER_OUTPUT bin coverage.out ENV DAPPER_SOURCE /go/src/github.com/longhorn/backing-image-manager -WORKDIR ${DAPPER_SOURCE} +WORKDIR ${DAPPER_SOURCE} +ENTRYPOINT ["./scripts/entry"] +CMD ["ci"] RUN zypper -n addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/SLE_15/system:snappy.repo && \ - zypper --gpg-auto-import-keys ref + zypper --gpg-auto-import-keys ref && \ + zypper -n ref && \ + zypper update -y # Install packages RUN zypper -n install cmake wget curl git less file \ @@ -23,25 +30,15 @@ RUN zypper -n install cmake wget curl git less file \ bash-completion librdmacm1 librdmacm-utils libibverbs xsltproc docbook-xsl-stylesheets \ perl-Config-General libaio-devel glibc-devel-static glibc-devel iptables libltdl7 libdevmapper1_03 iproute2 jq docker gcc -# needed for ${!var} substitution +# FIXME: Needed for ${!var} substitution RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh -RUN if [ ${ARCH} == "s390x" ]; then \ - ln -s /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc;\ - fi +# Install tools -# Install Go & tools -ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm64=arm64 GOLANG_ARCH_s390x=s390x GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ - GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash -RUN wget -O - https://storage.googleapis.com/golang/go1.21.3.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local +## golangci-lint RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 -# The docker version in dapper is too old to have buildx. Install it manually. +## Docker Buildx: The docker version in dapper is too old to have buildx. Install it manually. RUN wget https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} && \ chmod +x buildx-v0.13.1.linux-${ARCH} && \ mv buildx-v0.13.1.linux-${ARCH} /usr/local/bin/buildx - -VOLUME /tmp -ENV TMPDIR /tmp -ENTRYPOINT ["./scripts/entry"] -CMD ["ci"] From c79e83d9199ee083a74911c38d4f936b403395c3 Mon Sep 17 00:00:00 2001 From: David Ko Date: Mon, 17 Jun 2024 20:36:22 +0800 Subject: [PATCH 2/2] Update Dockerfile.dapper Signed-off-by: David Ko --- Dockerfile.dapper | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 23a7a9e8..b2da3cea 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -1,8 +1,4 @@ -<<<<<<< HEAD -FROM registry.suse.com/bci/bci-base:15.5 -======= FROM registry.suse.com/bci/golang:1.22 ->>>>>>> d1662b2 (ci: use golang bci instead of manual download) ARG DAPPER_HOST_ARCH ARG http_proxy