Skip to content

Commit

Permalink
fix(dockerfile): fix "/spdk not found" error
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Su <[email protected]>
(cherry picked from commit e3aed7d)
  • Loading branch information
derekbit authored and innobead committed Jul 12, 2024
1 parent 77830e4 commit caa836e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 0 additions & 5 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,3 @@ RUN curl -sSfLO https://github.com/docker/buildx/releases/download/v0.13.1/build
chmod +x buildx-v0.13.1.linux-${ARCH} && \
mv buildx-v0.13.1.linux-${ARCH} /usr/local/bin/buildx

ENV SPDK_COMMIT_ID 4542f9b14010fc7192d42e05adaafc2ae863bac5
RUN cd /usr/src && \
git clone https://github.com/longhorn/spdk.git /spdk && \
cd /spdk && \
git checkout ${SPDK_COMMIT_ID}
4 changes: 0 additions & 4 deletions dapper/package
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ if [ ! -e ./bin/longhornctl ]; then
./dapper/build
fi

# Copy SPDK scripts from the dapper container
mkdir -p /spdk
cp -rf /spdk/scripts spdk

# Build image
buildx build --load -t ${IMAGE} -f package/Dockerfile .

Expand Down
18 changes: 17 additions & 1 deletion package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# syntax=docker/dockerfile:1.8.1

FROM registry.suse.com/bci/golang:1.22 AS builder

ARG ARCH=amd64

RUN zypper -n ref && \
zypper update -y

ENV SPDK_COMMIT_ID a6478cde7e0cff2fb09992868308a7387aa5202a
RUN cd /usr/src && \
git clone https://github.com/longhorn/spdk.git /spdk && \
cd /spdk && \
git checkout ${SPDK_COMMIT_ID} && \
rm -rf .git

FROM registry.suse.com/bci/bci-base:15.6

ARG TARGETPLATFORM
Expand All @@ -19,6 +33,8 @@ RUN zypper -n install jq && \
COPY bin/longhornctl-linux-${ARCH} /usr/local/bin/longhornctl
COPY bin/longhornctl-local-linux-${ARCH} /usr/local/bin/longhornctl-local

COPY spdk /spdk
COPY --from=builder \
/spdk \
/spdk

CMD ["longhornctl"]

0 comments on commit caa836e

Please sign in to comment.