-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile.dapper
91 lines (77 loc) · 3.63 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
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}
# 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 coverage.out
ENV DAPPER_RUN_ARGS --privileged -v /dev:/host/dev -v /proc:/host/proc -v /sys:/host/sys
ENV DAPPER_SOURCE /go/src/github.com/longhorn/go-spdk-helper
ENV GOLANGCI_LINT_VERSION="v1.60.3"
WORKDIR ${DAPPER_SOURCE}
ENV SPDK_COMMIT_ID a7421a6e59f1d099294af6f65d73ebec4afebfc5
ENV LIBJSONC_COMMIT_ID b4c371fa0cbc4dcbaccc359ce9e957a22988fb34
# Build nvme-cli 2.10.2
ENV NVME_CLI_COMMIT_ID eeaa08c9a0e9184f3889df0bff3d2a23db6d6294
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 wget unzip xsltproc docbook-xsl-stylesheets python311 python311-pip fuse3 libfuse3-3 \
e2fsprogs xfsprogs util-linux-systemd device-mapper
# 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}
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
RUN ldconfig
VOLUME /tmp
ENV TMPDIR /tmp
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]