mirror of
https://github.com/containers/skopeo.git
synced 2025-06-29 16:17:44 +00:00
Add static compile target in Makefile.
Add install `go-md2man` in Dockerfile.build Signed-off-by: Ye Yin <eyniy@qq.com>
This commit is contained in:
parent
bd816574ed
commit
12cc3a9cbf
@ -1,5 +1,5 @@
|
|||||||
FROM ubuntu:16.04
|
FROM ubuntu:16.04
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y golang git-core libgpgme11-dev
|
RUN apt-get install -y golang git-core libgpgme11-dev go-md2man
|
||||||
ENV GOPATH=/
|
ENV GOPATH=/
|
||||||
WORKDIR /src/github.com/projectatomic/skopeo
|
WORKDIR /src/github.com/projectatomic/skopeo
|
||||||
|
9
Makefile
9
Makefile
@ -36,7 +36,7 @@ MANPAGES_MD = $(wildcard docs/*.md)
|
|||||||
# Note: Uses the -N -l go compiler options to disable compiler optimizations
|
# Note: Uses the -N -l go compiler options to disable compiler optimizations
|
||||||
# and inlining. Using these build options allows you to subsequently
|
# and inlining. Using these build options allows you to subsequently
|
||||||
# use source debugging tools like delve.
|
# use source debugging tools like delve.
|
||||||
all: binary docs
|
all: binary binary-static docs
|
||||||
|
|
||||||
# Build a docker image (skopeobuild) that has everything we need to build.
|
# Build a docker image (skopeobuild) that has everything we need to build.
|
||||||
# Then do the build and the output (skopeo) should appear in current dir
|
# Then do the build and the output (skopeo) should appear in current dir
|
||||||
@ -45,10 +45,17 @@ binary: cmd/skopeo
|
|||||||
docker run --rm --security-opt label:disable -v $$(pwd):/src/github.com/projectatomic/skopeo \
|
docker run --rm --security-opt label:disable -v $$(pwd):/src/github.com/projectatomic/skopeo \
|
||||||
skopeobuildimage make binary-local $(if $(DEBUG),DEBUG=$(DEBUG))
|
skopeobuildimage make binary-local $(if $(DEBUG),DEBUG=$(DEBUG))
|
||||||
|
|
||||||
|
binary-static: cmd/skopeo
|
||||||
|
docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage .
|
||||||
|
docker run --rm --security-opt label:disable -v $$(pwd):/src/github.com/projectatomic/skopeo \
|
||||||
|
skopeobuildimage make binary-local-static $(if $(DEBUG),DEBUG=$(DEBUG))
|
||||||
|
|
||||||
# Build w/o using Docker containers
|
# Build w/o using Docker containers
|
||||||
binary-local:
|
binary-local:
|
||||||
go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -o skopeo ./cmd/skopeo
|
go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -o skopeo ./cmd/skopeo
|
||||||
|
|
||||||
|
binary-local-static:
|
||||||
|
go build -ldflags "-extldflags \"-static\" -X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -o skopeo ./cmd/skopeo
|
||||||
|
|
||||||
build-container:
|
build-container:
|
||||||
docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" .
|
docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" .
|
||||||
|
Loading…
Reference in New Issue
Block a user