forked from longhorn/longhorn-share-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dapper
72 lines (59 loc) · 3.01 KB
/
Dockerfile.dapper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM registry.suse.com/bci/bci-base:15.4
ARG DAPPER_HOST_ARCH=amd64
ARG http_proxy
ARG https_proxy
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
ENV PROTOBUF_VER=3.18.0
# Setup environment
ENV PATH /go/bin:$PATH
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_ENV TAG REPO
ENV DAPPER_OUTPUT bin coverage.out
ENV DAPPER_RUN_ARGS --privileged -v /dev:/host/dev -v /proc:/host/proc
ENV DAPPER_SOURCE /go/src/github.com/longhorn/longhorn-share-manager
WORKDIR ${DAPPER_SOURCE}
RUN zypper -n addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/SLE_15/ snappy && \
zypper --gpg-auto-import-keys ref
# Install packages
RUN zypper -n install cmake wget curl git less file libkmod2 libnl3-devel linux-glibc-devel pkg-config psmisc python3-tox qemu-tools fuse python3 bash-completion librdmacm1 libibverbs libaio-devel glibc iptables libltdl7 libdevmapper1_03 iproute2 jq tar unzip gcc linux-glibc-devel glibc-devel-static glibc-devel awk docker && \
rm -rf /var/cache/zypp/*
# 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 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.17.10.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
go get -u golang.org/x/lint/golint
# GRPC dependencies
# GRPC health probe
ENV GRPC_HEALTH_PROBE_amd64=https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.2/grpc_health_probe-linux-amd64 \
GRPC_HEALTH_PROBE_arm64=https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.2/grpc_health_probe-linux-arm64 \
GRPC_HEALTH_PROBE_s390x=https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.3.2/grpc_health_probe-linux-s390x \
GRPC_HEALTH_PROBE=GRPC_HEALTH_PROBE_${ARCH}
RUN wget ${!GRPC_HEALTH_PROBE} -O /usr/local/bin/grpc_health_probe && \
chmod +x /usr/local/bin/grpc_health_probe
# protoc
ENV PROTOC_amd64=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VER}/protoc-${PROTOBUF_VER}-linux-x86_64.zip \
PROTOC_arm64=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VER}/protoc-${PROTOBUF_VER}-linux-aarch_64.zip \
PROTOC_s390x=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VER}/protoc-${PROTOBUF_VER}-linux-s390_64.zip \
PROTOC=PROTOC_${ARCH}
RUN cd /usr/src && \
wget ${!PROTOC} -O protoc_${ARCH}.zip && \
unzip protoc_${ARCH}.zip -d /usr/local/
# protoc-gen-go
RUN cd /go/src/github.com/ && \
mkdir golang/ && \
cd golang && \
git clone https://github.com/golang/protobuf.git && \
cd protobuf && \
git checkout v1.3.2 && \
cd protoc-gen-go && \
go build && \
cp protoc-gen-go /usr/local/bin
VOLUME /tmp
ENV TMPDIR /tmp
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]