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

Add the base image pingcap/alpine-glibc:alpine-3.14.6 for releasing vineyardd and bump up etcd to v3.5.13 #1856

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 15 additions & 7 deletions docker/Dockerfile.vineyardd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG MODE=release

FROM ghcr.io/v6d-io/v6d/vineyardd-alpine-builder:builder-latest as builder

RUN export arch="$PLATFORM" && \
Expand All @@ -26,9 +28,9 @@ RUN export arch="$PLATFORM" && \
curl -LO https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_$arch && \
chmod +x dumb-init_1.2.2_$arch && \
mv /tmp/dumb-init_1.2.2_$arch /usr/bin/dumb-init && \
curl -LO https://github.com/etcd-io/etcd/releases/download/v3.5.9/etcd-v3.5.9-linux-$arch.tar.gz && \
tar zxf etcd-v3.5.9-linux-$arch.tar.gz && \
mv /tmp/etcd-v3.5.9-linux-$arch/etcd /usr/bin/etcd && \
curl -LO https://github.com/etcd-io/etcd/releases/download/v3.5.13/etcd-v3.5.13-linux-$arch.tar.gz && \
tar zxf etcd-v3.5.13-linux-$arch.tar.gz && \
mv /tmp/etcd-v3.5.13-linux-$arch/etcd /usr/bin/etcd && \
curl -LO https://dl.k8s.io/release/v1.24.0/bin/linux/$arch/kubectl && \
chmod +x kubectl && \
mv /tmp/kubectl /usr/bin/kubectl
Expand Down Expand Up @@ -73,17 +75,23 @@ RUN cd /work/v6d && \
make -j`nproc` && \
strip ./bin/vineyardd

# debug has busybox
FROM gcr.io/distroless/base:debug
FROM pingcap/alpine-glibc:alpine-3.14.6 as release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the distroless/base:debug image is by design for glibc dependencies.

Alpine based images won't work for certain syscalls.


SHELL ["/bin/bash", "-c"]
FROM gcr.io/distroless/base:debug as debug

FROM ${MODE}

COPY --from=builder /usr/bin/bash-linux /bin/bash
COPY --from=builder /usr/bin/dumb-init /usr/bin/dumb-init
COPY --from=builder /usr/bin/etcd /usr/bin/etcd
COPY --from=builder /usr/bin/kubectl /usr/bin/kubectl
COPY --from=builder /work/v6d/build/bin/vineyardd /usr/local/bin/vineyardd
RUN ln -s /busybox/env /usr/bin/env

SHELL ["/bin/bash", "-c"]

RUN if [ "$MODE" = "release" ]; then apk add --no-cache sudo; \
elif [ "$MODE" = "debug" ]; then ln -s /busybox/env /usr/bin/env; \
fi

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/usr/local/bin/vineyardd"]
15 changes: 14 additions & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ALPINE_IMAGE := vineyardd
ALPINE_VERSION := latest
ALPINE_MANIFEST_TAG := alpine-$(ALPINE_VERSION)
ALPINE_TAG := $(ALPINE_MANIFEST_TAG)_$(PLATFORM)
ALPINE_DEBUG_TAG := $(ALPINE_MANIFEST_TAG)_$(PLATFORM)_debug

WHEEL_BUILDER_REGISTRY := $(REGISTRY)
WHEEL_BUILDER_IMAGE := vineyard-manylinux2014
Expand Down Expand Up @@ -61,16 +62,28 @@ builder-manifest:
--amend $(BUILDER_REGISTRY)/$(BUILDER_IMAGE):$(BUILDER_MANIFEST_TAG)_aarch64
.PHONY: builder-manifest

# building standalone vineyardd
# building standalone vineyardd in release mode
vineyardd:
docker buildx build ../ \
--build-arg MODE=release \
--progress=$(BUILD_PROGRESS) \
--file ./Dockerfile.vineyardd \
-t ghcr.io/v6d-io/v6d/vineyardd:$(ALPINE_TAG) \
--load \
--platform linux/$(ARCH)
.PHONY: vineyardd

# building standalone vineyardd in debug mode
vineyardd-debug:
docker buildx build ../ \
--build-arg MODE=debug \
--progress=$(BUILD_PROGRESS) \
--file ./Dockerfile.vineyardd \
-t ghcr.io/v6d-io/v6d/vineyardd:$(ALPINE_DEBUG_TAG) \
--load \
--platform linux/$(ARCH)
.PHONY: vineyardd-debug

vineyardd-manifest:
docker manifest create $(ALPINE_REGISTRY)/$(ALPINE_IMAGE):$(ALPINE_MANIFEST_TAG) \
--amend $(ALPINE_REGISTRY)/$(ALPINE_IMAGE):$(ALPINE_MANIFEST_TAG)_x86_64 \
Expand Down
Loading