summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>2019-02-01 11:26:15 +0900
committerKunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>2019-02-01 11:36:52 +0900
commit5eb6fbe1c2373195c08b979e52498f0389a1f43e (patch)
tree9cce16ea26b81eb8af61b8d832a6a7bf7aedd0e6
parent805c6d997b4eb8941e7c2a12879bf9a5284835d0 (diff)
downloadpodman-5eb6fbe1c2373195c08b979e52498f0389a1f43e.tar.gz
podman-5eb6fbe1c2373195c08b979e52498f0389a1f43e.tar.bz2
podman-5eb6fbe1c2373195c08b979e52498f0389a1f43e.zip
Reduce Dockerfile based build time for libpod.
libpod code added at end of Dockerfile, avoids git clone of other packages in Dockerfile on subsequent builds. Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
-rw-r--r--Dockerfile17
-rw-r--r--Makefile1
2 files changed, 15 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile
index 59b5d5da3..6d44b963f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -41,9 +41,16 @@ RUN apt-get update && apt-get install -y \
--no-install-recommends \
&& apt-get clean
-ADD . /go/src/github.com/containers/libpod
-
-RUN set -x && cd /go/src/github.com/containers/libpod && make install.libseccomp.sudo
+ENV LIBSECCOMP_COMMIT release-2.3
+RUN set -x \
+ && git clone https://github.com/seccomp/libseccomp "$GOPATH/src/github.com/seccomp/libseccomp" \
+ && cd "$GOPATH/src/github.com/seccomp/libseccomp" \
+ && git fetch origin --tags \
+ && git checkout -q "$LIBSECCOMP_COMMIT" \
+ && ./autogen.sh \
+ && ./configure --prefix=/usr \
+ && make all \
+ && make install
# Install runc
ENV RUNC_COMMIT 96ec2177ae841256168fcf76954f7177af9446eb
@@ -126,4 +133,8 @@ RUN mkdir -p /etc/containers && curl https://raw.githubusercontent.com/projectat
COPY test/policy.json /etc/containers/policy.json
COPY test/redhat_sigstore.yaml /etc/containers/registries.d/registry.access.redhat.com.yaml
+ADD . /go/src/github.com/containers/libpod
+
+RUN set -x && cd /go/src/github.com/containers/libpod
+
WORKDIR /go/src/github.com/containers/libpod
diff --git a/Makefile b/Makefile
index f0f6a1fab..02f7293f5 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,7 @@ BUILD_INFO ?= $(shell date +%s)
LIBPOD := ${PROJECT}/libpod
LDFLAGS_PODMAN ?= $(LDFLAGS) -X $(LIBPOD).gitCommit=$(GIT_COMMIT) -X $(LIBPOD).buildInfo=$(BUILD_INFO)
ISODATE ?= $(shell date --iso-8601)
+#Update to LIBSECCOMP_COMMIT should reflect in Dockerfile too.
LIBSECCOMP_COMMIT := release-2.3
# If GOPATH not specified, use one in the local directory