mirror of
https://github.com/containers/skopeo.git
synced 2025-09-20 01:20:09 +00:00
Merge pull request #123 from duglin/modBuild
Build binary in a docker container
This commit is contained in:
5
Dockerfile.build
Normal file
5
Dockerfile.build
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM ubuntu:16.04
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install -y golang git-core libgpgme11-dev
|
||||||
|
ENV GOPATH=/
|
||||||
|
WORKDIR /src/github.com/projectatomic/skopeo
|
14
Makefile
14
Makefile
@@ -25,8 +25,18 @@ GIT_COMMIT := $(shell git rev-parse HEAD 2> /dev/null || true)
|
|||||||
|
|
||||||
all: binary
|
all: binary
|
||||||
|
|
||||||
binary:
|
binary: skopeo
|
||||||
go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -o ${DEST}skopeo ./cmd/skopeo
|
|
||||||
|
# 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
|
||||||
|
skopeo: cmd/skopeo
|
||||||
|
docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage .
|
||||||
|
docker run --rm -v ${PWD}:/src/github.com/projectatomic/skopeo \
|
||||||
|
skopeobuildimage make binary-local
|
||||||
|
|
||||||
|
# Build w/o using Docker containers
|
||||||
|
binary-local:
|
||||||
|
go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -o skopeo ./cmd/skopeo
|
||||||
|
|
||||||
build-container:
|
build-container:
|
||||||
docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" .
|
docker build ${DOCKER_BUILD_ARGS} -t "$(DOCKER_IMAGE)" .
|
||||||
|
@@ -8,7 +8,7 @@ bundle_test_integration() {
|
|||||||
|
|
||||||
# subshell so that we can export PATH without breaking other things
|
# subshell so that we can export PATH without breaking other things
|
||||||
(
|
(
|
||||||
make binary
|
make binary-local
|
||||||
make install-binary
|
make install-binary
|
||||||
export GO15VENDOREXPERIMENT=1
|
export GO15VENDOREXPERIMENT=1
|
||||||
bundle_test_integration
|
bundle_test_integration
|
||||||
|
Reference in New Issue
Block a user