Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dockerfile): fix missing spdk and longhornctl #25

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ RUN zypper -n install curl awk docker && \

RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}

# Docker Buildx: The docker version in dapper is too old to have buildx. Install it manually.
RUN curl -sSfLO https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} && \
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 && \
Expand Down
7 changes: 4 additions & 3 deletions dapper/package
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ if [ ! -e ./bin/longhornctl ]; then
fi

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

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

echo Built "${IMAGE}"
# shellcheck disable=SC2086
echo ${IMAGE} > ./bin/latest_image
14 changes: 13 additions & 1 deletion package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
# syntax=docker/dockerfile:1.8.1

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

ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/arm64" ]; then \
echo "Error: Unsupported TARGETPLATFORM: $TARGETPLATFORM" && \
exit 1; \
fi

ENV ARCH ${TARGETPLATFORM#linux/}

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

RUN zypper -n install jq && \
rm -rf /var/cache/zypp/*

COPY bin /usr/local/bin/
COPY bin/longhornctl-linux-${ARCH} /usr/local/bin/longhornctl
COPY bin/longhornctl-local-linux-${ARCH} /usr/local/bin/longhornctl-local

COPY spdk /spdk

CMD ["longhornctl"]