diff --git a/Dockerfile b/Dockerfile index 9a74815b..e55b0f66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,9 +27,9 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ GOARCH=${TARGET_ARCH} \ make -f builder.Makefile cli -FROM make-protos AS make-xcli +FROM make-protos AS make-cross RUN --mount=type=cache,target=/root/.cache/go-build \ - make -f builder.Makefile xcli + make -f builder.Makefile cross FROM scratch AS protos COPY --from=make-protos /go/src/github.com/docker/api . @@ -37,8 +37,8 @@ COPY --from=make-protos /go/src/github.com/docker/api . FROM scratch AS cli COPY --from=make-cli /go/src/github.com/docker/api/bin/* . -FROM scratch AS xcli -COPY --from=make-xcli /go/src/github.com/docker/api/bin/* . +FROM scratch AS cross +COPY --from=make-cross /go/src/github.com/docker/api/bin/* . FROM make-protos as test RUN make -f builder.Makefile test diff --git a/Makefile b/Makefile index 760e9a7f..06e2c2b9 100644 --- a/Makefile +++ b/Makefile @@ -44,10 +44,10 @@ cli: --build-arg TARGET_ARCH=${GOARCH} \ --target cli -xcli: +cross: @docker build . \ --output type=local,dest=./bin \ - --target xcli + --target cross test: @docker build . \ @@ -58,4 +58,4 @@ cache-clear: FORCE: -.PHONY: all protos cli xcli +.PHONY: all protos cli cross diff --git a/builder.Makefile b/builder.Makefile index 3cfabb3c..759c7931 100644 --- a/builder.Makefile +++ b/builder.Makefile @@ -40,7 +40,7 @@ protos: cli: GOOS=${GOOS} GOARCH=${GOARCH} go build -v -o bin/docker ./cli -xcli: +cross: @GOOS=linux GOARCH=amd64 go build -v -o bin/docker-linux-amd64 ./cli @GOOS=darwin GOARCH=amd64 go build -v -o bin/docker-darwin-amd64 ./cli @GOOS=windows GOARCH=amd64 go build -v -o bin/docker-windows-amd64.exe ./cli @@ -50,4 +50,4 @@ test: FORCE: -.PHONY: all protos cli xcli +.PHONY: all protos cli cross