|
1 |
| -FROM registry.suse.com/bci/bci-base:15.6 |
| 1 | +FROM registry.suse.com/bci/golang:1.22 |
2 | 2 |
|
3 |
| -ARG DAPPER_HOST_ARCH=amd64 |
| 3 | +ARG DAPPER_HOST_ARCH |
4 | 4 | ARG http_proxy
|
5 | 5 | ARG https_proxy
|
6 |
| -ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} |
7 | 6 |
|
8 |
| -# Setup environment |
| 7 | +ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} |
9 | 8 | ENV PATH /go/bin:$PATH
|
10 | 9 | ENV DAPPER_DOCKER_SOCKET true
|
11 | 10 | ENV DAPPER_ENV TAG REPO DRONE_REPO DRONE_PULL_REQUEST DRONE_COMMIT_REF
|
12 | 11 | ENV DAPPER_OUTPUT bin coverage.out
|
13 | 12 | ENV DAPPER_SOURCE /go/src/github.com/longhorn/backing-image-manager
|
14 |
| -WORKDIR ${DAPPER_SOURCE} |
15 | 13 |
|
| 14 | +WORKDIR ${DAPPER_SOURCE} |
| 15 | +ENTRYPOINT ["./scripts/entry"] |
| 16 | +CMD ["ci"] |
16 | 17 |
|
17 | 18 | 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 |
19 | 22 |
|
20 | 23 | # Install packages
|
21 | 24 | RUN zypper -n install cmake wget curl git less file \
|
22 | 25 | libkmod-devel libnl3-devel linux-glibc-devel pkg-config psmisc python3-tox fuse python3-devel qemu-tools \
|
23 | 26 | bash-completion librdmacm1 librdmacm-utils libibverbs xsltproc docbook-xsl-stylesheets \
|
24 | 27 | perl-Config-General libaio-devel glibc-devel-static glibc-devel iptables libltdl7 libdevmapper1_03 iproute2 jq docker gcc
|
25 | 28 |
|
26 |
| -# needed for ${!var} substitution |
| 29 | +# FIXME: Needed for ${!var} substitution |
27 | 30 | RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh
|
28 | 31 |
|
29 |
| -RUN if [ ${ARCH} == "s390x" ]; then \ |
30 |
| - ln -s /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc;\ |
31 |
| - fi |
| 32 | +# Install tools |
32 | 33 |
|
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 |
37 | 35 | RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
|
38 | 36 |
|
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. |
40 | 38 | RUN wget https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} && \
|
41 | 39 | chmod +x buildx-v0.13.1.linux-${ARCH} && \
|
42 | 40 | 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