Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1192 from justinbarrick/optimize-docker
Browse files Browse the repository at this point in the history
Optimize Docker cache usage for flux and helm-operator docker images.
  • Loading branch information
squaremo authored Jul 3, 2018
2 parents 9d5eb91 + ce6661e commit c795d61
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
21 changes: 12 additions & 9 deletions docker/Dockerfile.flux
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
FROM alpine:3.6

WORKDIR /home/flux

RUN apk add --no-cache openssh ca-certificates tini 'git>=2.3.0'

# Add git hosts to known hosts file so we can use
# StrickHostKeyChecking with git+ssh
RUN ssh-keyscan github.com gitlab.com bitbucket.org >> /etc/ssh/ssh_known_hosts
# Add default SSH config, which points at the private key we'll mount
COPY ./ssh_config /etc/ssh/ssh_config

COPY ./kubectl /usr/local/bin/

# These are pretty static
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="flux" \
Expand All @@ -14,22 +26,13 @@ LABEL maintainer="Weaveworks <[email protected]>" \
org.label-schema.vcs-url="[email protected]:weaveworks/flux" \
org.label-schema.vendor="Weaveworks"

WORKDIR /home/flux
ENTRYPOINT [ "/sbin/tini", "--", "fluxd" ]
RUN apk add --no-cache openssh ca-certificates tini 'git>=2.3.0'

# Get the kubeyaml binary (files) and put them on the path
COPY --from=quay.io/squaremo/kubeyaml:0.3.2 /usr/lib/kubeyaml /usr/lib/kubeyaml/
ENV PATH=/bin:/usr/bin:/usr/local/bin:/usr/lib/kubeyaml

# Add git hosts to known hosts file so we can use
# StrickHostKeyChecking with git+ssh
RUN ssh-keyscan github.com gitlab.com bitbucket.org >> /etc/ssh/ssh_known_hosts
# Add default SSH config, which points at the private key we'll mount
COPY ./ssh_config /etc/ssh/ssh_config

COPY ./kubeconfig /root/.kube/config
COPY ./kubectl /usr/local/bin/
COPY ./fluxd /usr/local/bin/

ARG BUILD_DATE
Expand Down
22 changes: 12 additions & 10 deletions docker/Dockerfile.helm-operator
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
FROM alpine:3.6

WORKDIR /home/flux

RUN apk add --no-cache openssh ca-certificates tini 'git>=2.3.0'

# Add git hosts to known hosts file so we can use
# StrickHostKeyChecking with git+ssh
RUN ssh-keyscan github.com gitlab.com bitbucket.org >> /etc/ssh/ssh_known_hosts
# Add default SSH config, which points at the private key we'll mount
COPY ./ssh_config /etc/ssh/ssh_config

COPY ./kubectl /usr/local/bin/

# These are pretty static
LABEL maintainer="Weaveworks <[email protected]>" \
org.opencontainers.image.title="flux-helm-operator" \
Expand All @@ -14,18 +26,8 @@ LABEL maintainer="Weaveworks <[email protected]>" \
org.label-schema.vcs-url="[email protected]:weaveworks/flux" \
org.label-schema.vendor="Weaveworks"

WORKDIR /home/flux
ENTRYPOINT [ "/sbin/tini", "--", "helm-operator" ]

RUN apk add --no-cache openssh ca-certificates tini 'git>=2.3.0'

# Add git hosts to known hosts file so we can use
# StrickHostKeyChecking with git+ssh
RUN ssh-keyscan github.com gitlab.com bitbucket.org >> /etc/ssh/ssh_known_hosts
# Add default SSH config, which points at the private key we'll mount
COPY ./ssh_config /etc/ssh/ssh_config

COPY ./kubectl /usr/local/bin/
COPY ./helm-operator /usr/local/bin/

ARG BUILD_DATE
Expand Down

0 comments on commit c795d61

Please sign in to comment.