-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile.dapper
54 lines (44 loc) · 1.64 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
FROM registry.suse.com/bci/golang:1.23
ARG DAPPER_HOST_ARCH=amd64
ARG http_proxy
ARG https_proxy
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
ENV GOLANGCI_LINT_VERSION="v1.60.3"
# Setup environment
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
ENV DAPPER_RUN_ARGS --privileged -v /dev:/host/dev -v /proc:/host/proc
ENV DAPPER_SOURCE /go/src/github.com/longhorn/go-iscsi-helper
WORKDIR ${DAPPER_SOURCE}
# Install packages
RUN zypper update -y && \
zypper -n install glibc gcc cmake curl awk xsltproc docbook-xsl-stylesheets open-iscsi docker && \
rm -rf /var/cache/zypp/*
# needed for ${!var} substitution
RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh
# Install Go & tools
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm64=arm64 GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
# Build liblonghorn
ENV LIBLONGHORN_COMMIT_ID 53d1c063b95efc8d949b095bd4bf04637230265f
RUN cd /usr/src && \
git clone https://github.com/rancher/liblonghorn.git && \
cd liblonghorn && \
git checkout ${LIBLONGHORN_COMMIT_ID} && \
make; \
make install
# Build tgt
ENV TGT_COMMIT_ID 3a8bc4823b5390e046f7aa8231ed262c0365c42c
RUN cd /usr/src && \
git clone https://github.com/rancher/tgt.git && \
cd tgt && \
git checkout ${TGT_COMMIT_ID} && \
make; \
make install
VOLUME /tmp
ENV TMPDIR /tmp
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]