Skip to content

Commit

Permalink
Use distroless rather than alpine-glibc as the base image (#1460)
Browse files Browse the repository at this point in the history
Signed-off-by: Tao He <[email protected]>
  • Loading branch information
sighingnow authored Jul 11, 2023
1 parent f85e6e0 commit 999bcd8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/vineyard-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ on:
- 'v*'
paths:
- '.github/workflows/vineyard-operator.yaml'
- 'charts/vineyard-operator/**'
- 'docker/Dockerfile.vineyardd*'
- 'k8s/**'
- 'src/server/util/kubectl*'
- 'charts/vineyard-operator/**'
pull_request:
branches:
- main
- dev/kubernetes
paths:
- '.github/workflows/vineyard-operator.yaml'
- 'charts/vineyard-operator/**'
- 'docker/Dockerfile.vineyardd*'
- 'k8s/**'
- 'src/server/util/kubectl*'
- 'charts/vineyard-operator/**'

concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
Expand Down
10 changes: 7 additions & 3 deletions docker/Dockerfile.vineyardd
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ FROM ghcr.io/v6d-io/v6d/vineyardd-alpine-builder:builder-latest as builder
RUN export arch="$PLATFORM" && \
export arch="${arch/x86_64/amd64}" && \
export arch="${arch/aarch64/arm64}" && \
echo "PLATFORM = $PLATFORM" && \
echo "arch = $arch" && \
cd /tmp && \
curl -LO https://github.com/robxu9/bash-static/releases/download/5.2.015-1.2.3-2/bash-linux-$PLATFORM && \
chmod +x bash-linux-$PLATFORM && \
mv /tmp/bash-linux-$PLATFORM /usr/bin/bash-linux && \
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 && \
Expand Down Expand Up @@ -61,10 +65,10 @@ RUN cd /work/v6d && \
make -j`nproc` && \
strip ./bin/vineyardd

FROM pingcap/alpine-glibc:alpine-3.14.3

RUN apk add --no-cache bash sudo
# debug has busybox
FROM gcr.io/distroless/base:debug

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/wait-for-it.sh /usr/bin/wait-for-it.sh
COPY --from=builder /usr/bin/etcd /usr/bin/etcd
Expand Down

0 comments on commit 999bcd8

Please sign in to comment.