-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile.dapper
94 lines (80 loc) · 4.09 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM registry.suse.com/bci/golang:1.23
ARG DAPPER_HOST_ARCH
ARG http_proxy
ARG https_proxy
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
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 coverage.out
ENV DAPPER_RUN_ARGS --privileged --tmpfs /go/src/github.com/longhorn/longhorn-spdk-engine/integration/.venv:exec --tmpfs /go/src/github.com/longhorn/longhorn-spdk-engine/integration/.tox:exec -v /dev:/host/dev -v /proc:/host/proc -v /sys:/host/sys -v /tmp:/tmp
ENV DAPPER_SOURCE /go/src/github.com/longhorn/longhorn-spdk-engine
ENV GOLANGCI_LINT_VERSION="v1.60.3"
ENV SPDK_COMMIT_ID 10463b5c13b454e173707628b9eac608081f5082
ENV LIBJSONC_COMMIT_ID b4c371fa0cbc4dcbaccc359ce9e957a22988fb34
# nvme-cli 2.9.1
ENV NVME_CLI_COMMIT_ID b340fd7dcf1aef76f8d46ab28bef3c170d310887
ENV GO_SPDK_HELPER_COMMIT_ID 6a324e95979662be592bfda0e867d2678ecbc756
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]
RUN zypper -n addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/SLE_15/system:snappy.repo && \
zypper -n addrepo --refresh https://download.opensuse.org/repositories/network:/utilities/SLE_15/network:utilities.repo && \
zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:libraries:c_c++/15.5/devel:libraries:c_c++.repo && \
zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:languages:python:Factory/15.5/devel:languages:python:Factory.repo && \
zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:languages:python:backports/SLE_15/devel:languages:python:backports.repo && \
zypper --gpg-auto-import-keys ref
RUN zypper -n install cmake curl wget gcc unzip tar xsltproc docbook-xsl-stylesheets python311 python311-pip fuse3 libfuse3-3 \
e2fsprogs xfsprogs util-linux-systemd libcmocka-devel device-mapper procps
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 & \
ln -sf /usr/bin/pip3.11 /usr/bin/pip3
# Build spdk
ENV SPDK_DIR /usr/src/spdk
RUN git clone https://github.com/longhorn/spdk.git ${SPDK_DIR} --recursive && \
cd ${SPDK_DIR} && \
git checkout ${SPDK_COMMIT_ID} && \
git submodule update --init && \
sed -i '/python3-pyelftools/d' ./scripts/pkgdep/sles.sh && \
sed -i 's/python3-/python311-/g' ./scripts/pkgdep/sles.sh && \
./scripts/pkgdep.sh && \
pip3 install -r ./scripts/pkgdep/requirements.txt && \
if [ ${ARCH} = "amd64" ]; then \
./configure --target-arch=nehalem --disable-tests --disable-unit-tests --disable-examples --without-nvme-cuse && \
make -j$(nproc) && \
make install; \
elif [ ${ARCH} = "arm64" ]; then \
./configure --target-arch=native --disable-tests --disable-unit-tests --disable-examples --without-nvme-cuse && \
DPDKBUILD_FLAGS="-Dplatform=generic" make -j$(nproc) && \
make install; \
else \
echo "Unsupported architecture: ${ARCH}"; \
exit 1; \
fi
# Build libjson-c-devel
RUN cd /usr/src && \
git clone https://github.com/json-c/json-c.git && \
cd json-c && \
git checkout ${LIBJSONC_COMMIT_ID} && \
mkdir .build && \
cd .build && \
cmake ../ && \
make && \
make install
# Build nvme-cli
ENV NVME_CLI_DIR /usr/src/nvme-cli
RUN git clone https://github.com/linux-nvme/nvme-cli.git ${NVME_CLI_DIR} && \
cd ${NVME_CLI_DIR} && \
git checkout ${NVME_CLI_COMMIT_ID} && \
meson setup --force-fallback-for=libnvme .build && \
meson compile -C .build && \
meson install -C .build
# longhorn/go-spdk-helper binary for debugging
ENV GO_SPDK_HELPER_DIR /usr/src/go-spdk-helper
RUN git clone https://github.com/longhorn/go-spdk-helper.git ${GO_SPDK_HELPER_DIR} && \
cd ${GO_SPDK_HELPER_DIR} && \
git checkout ${GO_SPDK_HELPER_COMMIT_ID} && \
go build && \
install -m 755 go-spdk-helper /usr/local/bin/go-spdk-helper && \
rm -rf ${GO_SPDK_HELPER_DIR}
RUN ldconfig