mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 11:21:02 +00:00
make in_docker work again (#1830)
This commit is contained in:
parent
556607b525
commit
101e684059
2 changed files with 8 additions and 8 deletions
5
Makefile
5
Makefile
|
@ -35,17 +35,16 @@ ifeq (in_docker,$(firstword $(MAKECMDGOALS)))
|
|||
$(eval $(MAKE_ARGS):;@:)
|
||||
|
||||
in_docker:
|
||||
@[ "1" -eq "$(shell docker image ls woodpecker/make:local -a | wc -l)" ] && docker build -f ./docker/Dockerfile.make -t woodpecker/make:local . || echo reuse existing docker image
|
||||
@[ "1" -eq "$(shell docker image ls woodpecker/make:local -a | wc -l)" ] && docker buildx build -f ./docker/Dockerfile.make -t woodpecker/make:local --load . || echo reuse existing docker image
|
||||
@echo run in docker:
|
||||
@docker run -it \
|
||||
--user $(shell id -u):$(shell id -g) \
|
||||
-e VERSION="$(VERSION)" \
|
||||
-e BUILD_VERSION="$(BUILD_VERSION)" \
|
||||
-e CI_COMMIT_SHA="$(CI_COMMIT_SHA)" \
|
||||
-e GO_PACKAGES="$(GO_PACKAGES)" \
|
||||
-e TARGETOS="$(TARGETOS)" \
|
||||
-e TARGETARCH="$(TARGETARCH)" \
|
||||
-e CGO_ENABLED="$(CGO_ENABLED)"
|
||||
-e CGO_ENABLED="$(CGO_ENABLED)" \
|
||||
-e GOPATH=/tmp/go \
|
||||
-e HOME=/tmp/home \
|
||||
-v $(PWD):/build --rm woodpecker/make:local make $(MAKE_ARGS)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# docker build --rm -f docker/Dockerfile.server -t woodpeckerci/woodpecker-server .
|
||||
# docker build --rm -f docker/Dockerfile.make -t woodpecker/make:local .
|
||||
FROM golang:1.20-alpine as golang_image
|
||||
FROM node:18-alpine
|
||||
|
||||
|
@ -10,10 +10,11 @@ COPY --from=golang_image /usr/local/go /usr/local/go
|
|||
ENV PATH=$PATH:/usr/local/go/bin
|
||||
|
||||
# Cache tools
|
||||
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && \
|
||||
go install github.com/rs/zerolog/cmd/lint@latest && \
|
||||
go install mvdan.cc/gofumpt@latest
|
||||
RUN make install-tools && \
|
||||
mv /root/go/bin/* /usr/local/go/bin/ && \
|
||||
chmod 755 /usr/local/go/bin/*
|
||||
|
||||
WORKDIR /build
|
||||
RUN chmod -R 777 /root
|
||||
|
||||
CMD [ "sh" ]
|
||||
CMD [ "/bin/sh" ]
|
||||
|
|
Loading…
Reference in a new issue