From 541920c770f492e60ce43533218d88347dab4400 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Fri, 17 Jul 2015 06:40:04 -0700 Subject: [PATCH] Re-add back root Dockerfile for cross comiling and with GOPATH setup correctly. Fix notary-server Dockerfile so the COPY is after the run otherwise the cache will bust on the COPY and you wind up having to run the RUN apt-get every single time you build the Dockerfile. Signed-off-by: Jessica Frazelle --- Dockerfile | 14 ++++++++++++++ notary-server-Dockerfile | 8 +++++--- notary-signer-Dockerfile | 20 +++++++++++++++++--- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..7db6e76a07 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.4.2-cross + +RUN apt-get update && apt-get install -y \ + libltdl-dev \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +RUN go get golang.org/x/tools/cmd/vet + +COPY . /go/src/github.com/docker/notary + +ENV GOPATH /go/src/github.com/docker/notary/Godeps/_workspace:$GOPATH + +WORKDIR /go/src/github.com/docker/notary diff --git a/notary-server-Dockerfile b/notary-server-Dockerfile index 3cb322bf82..a638040d51 100644 --- a/notary-server-Dockerfile +++ b/notary-server-Dockerfile @@ -1,9 +1,11 @@ FROM golang -COPY . /go/src/github.com/docker/notary - RUN apt-get update && apt-get install -y \ - libltdl-dev + libltdl-dev \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +COPY . /go/src/github.com/docker/notary ENV GOPATH /go/src/github.com/docker/notary/Godeps/_workspace:$GOPATH diff --git a/notary-signer-Dockerfile b/notary-signer-Dockerfile index f29c7e491f..ef4a0d03f5 100644 --- a/notary-signer-Dockerfile +++ b/notary-signer-Dockerfile @@ -8,9 +8,23 @@ ENV SOPIN="1234" ENV LIBDIR="/usr/local/lib/softhsm/" # Install openSC and dependencies -RUN apt-get update - -RUN apt-get install -y build-essential autoconf automake libtool gtk-doc-tools gengetopt help2man libpcsclite-dev libzip-dev opensc libssl-dev usbutils vim +RUN apt-get update && \ + apt-get install -y \ + build-essential \ + autoconf \ + automake \ + libtool \ + gtk-doc-tools \ + gengetopt \ + help2man \ + libpcsclite-dev \ + libzip-dev \ + opensc \ + libssl-dev \ + usbutils \ + vim \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* # Initialize the SoftHSM2 token on slod 0, using PIN and SOPIN varaibles RUN softhsm2-util --init-token --slot 0 --label "test_token" --pin $PIN --so-pin $SOPIN