FROM registry.suse.com/bci/golang:1.22.7 ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH RUN zypper -n install tar gzip bash git gcc docker vim less file curl wget ca-certificates RUN zypper addrepo http://download.opensuse.org/distribution/leap/15.3/repo/oss/ oss && \ zypper --gpg-auto-import-keys refresh && \ zypper in -y qemu-x86 qemu-tools RUN export K8S_VERSION=1.24.2 && \ curl -sSLo envtest-bins.tar.gz "https://go.kubebuilder.io/test-tools/${K8S_VERSION}/$(go env GOOS)/$(go env GOARCH)" && \ mkdir /usr/local/kubebuilder && \ tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.57.1/install.sh | sh -s v1.57.1 # The docker version in dapper is too old to have buildx. Install it manually. RUN curl -sSfL https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} -o 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 ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS ENV DAPPER_SOURCE /go/src/github.com/harvester/vm-import-controller ENV DAPPER_OUTPUT ./bin ENV DAPPER_DOCKER_SOCKET true ENV DAPPER_RUN_ARGS "--network=host" WORKDIR ${DAPPER_SOURCE} ENTRYPOINT ["./scripts/entry"] CMD ["ci"]