mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-29 05:11:04 +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):;@:)
|
$(eval $(MAKE_ARGS):;@:)
|
||||||
|
|
||||||
in_docker:
|
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:
|
@echo run in docker:
|
||||||
@docker run -it \
|
@docker run -it \
|
||||||
--user $(shell id -u):$(shell id -g) \
|
--user $(shell id -u):$(shell id -g) \
|
||||||
-e VERSION="$(VERSION)" \
|
-e VERSION="$(VERSION)" \
|
||||||
-e BUILD_VERSION="$(BUILD_VERSION)" \
|
-e BUILD_VERSION="$(BUILD_VERSION)" \
|
||||||
-e CI_COMMIT_SHA="$(CI_COMMIT_SHA)" \
|
-e CI_COMMIT_SHA="$(CI_COMMIT_SHA)" \
|
||||||
-e GO_PACKAGES="$(GO_PACKAGES)" \
|
|
||||||
-e TARGETOS="$(TARGETOS)" \
|
-e TARGETOS="$(TARGETOS)" \
|
||||||
-e TARGETARCH="$(TARGETARCH)" \
|
-e TARGETARCH="$(TARGETARCH)" \
|
||||||
-e CGO_ENABLED="$(CGO_ENABLED)"
|
-e CGO_ENABLED="$(CGO_ENABLED)" \
|
||||||
-e GOPATH=/tmp/go \
|
-e GOPATH=/tmp/go \
|
||||||
-e HOME=/tmp/home \
|
-e HOME=/tmp/home \
|
||||||
-v $(PWD):/build --rm woodpecker/make:local make $(MAKE_ARGS)
|
-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 golang:1.20-alpine as golang_image
|
||||||
FROM node:18-alpine
|
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
|
ENV PATH=$PATH:/usr/local/go/bin
|
||||||
|
|
||||||
# Cache tools
|
# Cache tools
|
||||||
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && \
|
RUN make install-tools && \
|
||||||
go install github.com/rs/zerolog/cmd/lint@latest && \
|
mv /root/go/bin/* /usr/local/go/bin/ && \
|
||||||
go install mvdan.cc/gofumpt@latest
|
chmod 755 /usr/local/go/bin/*
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
RUN chmod -R 777 /root
|
||||||
|
|
||||||
CMD [ "sh" ]
|
CMD [ "/bin/sh" ]
|
||||||
|
|
Loading…
Reference in a new issue