Skip to content

Commit

Permalink
Simplify no-dapper workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed May 29, 2024
1 parent edd8f35 commit c1170e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ RUN --mount=type=cache,id=gomod,target=/go/pkg/mod \
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
./scripts/build

COPY ./scripts/package ./scripts/entry ./scripts/
COPY ./package ./package
CMD ./scripts/entry package

FROM scratch as binary
ENV SRC_DIR=/go/src/github.com/k3s-io/kine
COPY --from=build ${SRC_DIR}/bin /bin
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ ifneq ($(DIRTY),)
DIRTY="-dirty"
endif

.PHONY: no-dapper
no-dapper:
.PHONY: validate
validate:
DOCKER_BUILDKIT=1 docker build \
$(DEFAULT_BUILD_ARGS) --build-arg="SKIP_VALIDATE=$(SKIP_VALIDATE)" \
--target=validate -f Dockerfile .
DOCKER_BUILDKIT=1 docker build \
$(DEFAULT_BUILD_ARGS) --build-arg="DRONE_TAG=$(DRONE_TAG)" --build-arg="CROSS=$(CROSS)" \
-f Dockerfile --target=build -t kine-build .

.PHONY: build
build:
DOCKER_BUILDKIT=1 docker build \
$(DEFAULT_BUILD_ARGS) --build-arg="DRONE_TAG=$(DRONE_TAG)" --build-arg="CROSS=$(CROSS)" \
-f Dockerfile --target=binary --output=. .
DOCKER_BUILDKIT=1 docker run -v /var/run/docker.sock:/var/run/docker.sock -v ./dist:/go/src/github.com/k3s-io/kine/dist \
-e DAPPER_UID=1000 -e DAPPER_GID=1000 -e IMAGE_NAME -e DRONE_TAG -e DIRTY=$(DIRTY) kine-build

.PHONY: no-dapper
no-dapper: validate build
./scripts/package

0 comments on commit c1170e4

Please sign in to comment.