Skip to content

Commit d1662b2

Browse files
committed
ci: use golang bci instead of manual download
Signed-off-by: davidko <[email protected]>
1 parent 2817830 commit d1662b2

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

Dockerfile.dapper

+13-20
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,40 @@
1-
FROM registry.suse.com/bci/bci-base:15.6
1+
FROM registry.suse.com/bci/golang:1.22
22

3-
ARG DAPPER_HOST_ARCH=amd64
3+
ARG DAPPER_HOST_ARCH
44
ARG http_proxy
55
ARG https_proxy
6-
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
76

8-
# Setup environment
7+
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
98
ENV PATH /go/bin:$PATH
109
ENV DAPPER_DOCKER_SOCKET true
1110
ENV DAPPER_ENV TAG REPO DRONE_REPO DRONE_PULL_REQUEST DRONE_COMMIT_REF
1211
ENV DAPPER_OUTPUT bin coverage.out
1312
ENV DAPPER_SOURCE /go/src/github.com/longhorn/backing-image-manager
14-
WORKDIR ${DAPPER_SOURCE}
1513

14+
WORKDIR ${DAPPER_SOURCE}
15+
ENTRYPOINT ["./scripts/entry"]
16+
CMD ["ci"]
1617

1718
RUN zypper -n addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/SLE_15/system:snappy.repo && \
18-
zypper --gpg-auto-import-keys ref
19+
zypper --gpg-auto-import-keys ref && \
20+
zypper -n ref && \
21+
zypper update -y
1922

2023
# Install packages
2124
RUN zypper -n install cmake wget curl git less file \
2225
libkmod-devel libnl3-devel linux-glibc-devel pkg-config psmisc python3-tox fuse python3-devel qemu-tools \
2326
bash-completion librdmacm1 librdmacm-utils libibverbs xsltproc docbook-xsl-stylesheets \
2427
perl-Config-General libaio-devel glibc-devel-static glibc-devel iptables libltdl7 libdevmapper1_03 iproute2 jq docker gcc
2528

26-
# needed for ${!var} substitution
29+
# FIXME: Needed for ${!var} substitution
2730
RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh
2831

29-
RUN if [ ${ARCH} == "s390x" ]; then \
30-
ln -s /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc;\
31-
fi
32+
# Install tools
3233

33-
# Install Go & tools
34-
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm64=arm64 GOLANG_ARCH_s390x=s390x GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
35-
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
36-
RUN wget -O - https://storage.googleapis.com/golang/go1.21.3.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local
34+
## golangci-lint
3735
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
3836

39-
# The docker version in dapper is too old to have buildx. Install it manually.
37+
## Docker Buildx: The docker version in dapper is too old to have buildx. Install it manually.
4038
RUN wget https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} && \
4139
chmod +x buildx-v0.13.1.linux-${ARCH} && \
4240
mv buildx-v0.13.1.linux-${ARCH} /usr/local/bin/buildx
43-
44-
VOLUME /tmp
45-
ENV TMPDIR /tmp
46-
ENTRYPOINT ["./scripts/entry"]
47-
CMD ["ci"]

0 commit comments

Comments
 (0)