Skip to content

Commit

Permalink
Merge pull request #199 from kubernetes-simulator/improve-docker-buil…
Browse files Browse the repository at this point in the history
…d-cache

fix(build): only add needed  files for golang build
  • Loading branch information
jondkent authored Feb 3, 2020
2 parents 165ff4a + 43e119b commit 7707f5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,13 @@ USER ${build_user}
WORKDIR /go/src/github.com/controlplaneio/simulator-standalone

# Add the full source tree
COPY --chown=1000 . /go/src/github.com/controlplaneio/simulator-standalone/
COPY --chown=1000 Makefile /go/src/github.com/controlplaneio/simulator-standalone/
COPY --chown=1000 prelude.mk /go/src/github.com/controlplaneio/simulator-standalone/
COPY --chown=1000 main.go /go/src/github.com/controlplaneio/simulator-standalone/
COPY --chown=1000 pkg/ /go/src/github.com/controlplaneio/simulator-standalone/pkg
COPY --chown=1000 cmd/ /go/src/github.com/controlplaneio/simulator-standalone/cmd
COPY --chown=1000 test/ /go/src/github.com/controlplaneio/simulator-standalone/test

WORKDIR /go/src/github.com/controlplaneio/simulator-standalone/

# TODO: (rem) why is this owned by root after the earlier chmod?
Expand Down Expand Up @@ -205,7 +211,7 @@ RUN tar -C /usr/local -xzf go*.linux-amd64.tar.gz \
ENV PATH $PATH:/usr/local/go/bin

# Add login message
COPY --from=build-and-test /go/src/github.com/controlplaneio/simulator-standalone/scripts/launch-motd /usr/local/bin/launch-motd
COPY ./scripts/launch-motd /usr/local/bin/launch-motd
RUN echo '[ ! -z "$TERM" ] && source /usr/local/bin/launch-motd' >> /etc/bash.bashrc

# Use 3rd party dependencies from build
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ dep: go.mod ## Install dependencies for other targets

.PHONY: static-analysis
static-analysis: dep
ls -al
golangci-lint run

.PHONY: build
Expand Down

0 comments on commit 7707f5e

Please sign in to comment.