File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM minio/mc:latest as mc
22
33
4+ FROM drycc/go-dev:latest AS build
5+ ARG LDFLAGS
6+ ADD . /app
7+ RUN export GO111MODULE=on \
8+ && cd /app \
9+ && CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /usr/local/bin/boot boot.go
10+
11+
412FROM alpine:3.12
513
614RUN adduser \
@@ -10,8 +18,9 @@ RUN adduser \
1018 git \
1119 git
1220
13- COPY . /
21+ COPY rootfs /
1422COPY --from=mc /usr/bin/mc /bin/mc
23+ COPY --from=build /usr/local/bin/boot /usr/bin/boot
1524
1625RUN apk add --update git sudo openssh-server coreutils tar xz jq bash \
1726 && mkdir -p /var/run/sshd \
Original file line number Diff line number Diff line change @@ -43,12 +43,12 @@ test-unit:
4343test-cover :
4444 ${DEV_ENV_CMD} test-cover.sh
4545
46- docker-build : build
47- docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} rootfs
46+ docker-build :
47+ docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} --build-arg LDFLAGS= ${LDFLAGS} .
4848 docker tag ${IMAGE} ${MUTABLE_IMAGE}
4949
5050docker-buildx :
51- docker buildx build --platform ${PLATFORM} -t ${IMAGE} rootfs --push
51+ docker buildx build --platform ${PLATFORM} -t ${IMAGE} --build-arg LDFLAGS= ${LDFLAGS} . --push
5252
5353check-kubectl :
5454 @if [ -z $$ (which kubectl) ]; then \
You can’t perform that action at this time.
0 commit comments