@dexhorthy
@dexhorthy
FROM busybox:latest
VOLUMES [“/config”]
ADD . /shippedConfig
CMD cp /shippedConfig/* /config/
{...}
.
├── Dockerfile
└── my.cnf
$ docker run --name config test/config:dev
{...}
$ docker run --volumes-from config busybox 
/bin/sh -c “cat /config/my.cnf”
busybox
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y install curl apt-transport-https
RUN mkdir -p /packages
# ...snip
COPY ./kubernetes.list /etc/apt/sources.list.d/kubernetes.list
RUN apt-get update
RUN apt-get install --download-only -y 
kubeadm kubelet kubectl kubernetes-cni 
-oDebug::NoLocking=1 -o=dir::cache=/packages/
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y install curl apt-transport-https
RUN mkdir -p /packages
# ...snip
COPY ./kubernetes.list /etc/apt/sources.list.d/kubernetes.list
RUN apt-get update
RUN apt-get install --download-only -y 
kubeadm kubelet kubectl kubernetes-cni 
-oDebug::NoLocking=1 -o=dir::cache=/packages/
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y install curl apt-transport-https
RUN mkdir -p /packages
# ...snip
COPY ./kubernetes.list /etc/apt/sources.list.d/kubernetes.list
RUN apt-get update
RUN apt-get install --download-only -y 
kubeadm kubelet kubectl kubernetes-cni 
-oDebug::NoLocking=1 -o=dir::cache=/packages/
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y install curl apt-transport-https
RUN mkdir -p /packages
# ...snip
COPY ./kubernetes.list /etc/apt/sources.list.d/kubernetes.list
RUN apt-get update
RUN apt-get install --download-only -y 
kubeadm kubelet kubectl 
kubernetes-cni 
-oDebug::NoLocking=1 -o=dir::cache=/packages/
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y install curl apt-transport-https
RUN mkdir -p /packages
# ...snip
COPY ./kubernetes.list /etc/apt/sources.list.d/kubernetes.list
RUN apt-get update
RUN apt-get install --download-only -y 
kubeadm kubelet kubectl kubernetes-cni 
-oDebug::NoLocking=1 -o=dir::cache=/packages/
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y install curl apt-transport-https
RUN mkdir -p /packages
# ...snip
COPY ./kubernetes.list /etc/apt/sources.list.d/kubernetes.list
RUN apt-get update
RUN apt-get install --download-only -y 
kubeadm kubelet kubectl kubernetes-cni 
-oDebug::NoLocking=1 -o=dir::cache=/packages/
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -y install curl apt-transport-https
RUN mkdir -p /packages
# ...snip
COPY ./kubernetes.list /etc/apt/sources.list.d/kubernetes.list
RUN apt-get update
RUN apt-get install --download-only -y 
kubeadm kubelet kubectl kubernetes-cni 
-oDebug::NoLocking=1 -o=dir::cache=/packages/
FROM busybox:latest
COPY --from=0 /packages /packages
CMD cp -r /packages/* /out/
$ docker run -v ${PWD}:/out 
gcr.io/replicated-equip/k8s-packages:ubuntu-1604-v1.9.3
$ sudo dpkg -i archives/*.deb
$ ls -l archives
total 57304
-rw-r--r-- 1 root root 79416 Apr 17 14:12 ebtables_2.0.10.4-3.4ubuntu2_amd64.deb
-rw-r--r-- 1 root root 97500 Apr 17 14:12 ethtool_1%3a4.5-1_amd64.deb
-rw-r--r-- 1 root root 522092 Apr 17 14:12 iproute2_4.3.0-1ubuntu3.16.04.3_amd64.deb
-rw-r--r-- 1 root root 265782 Apr 17 14:12 iptables_1.6.0-2ubuntu3_amd64.deb
-rw-r--r-- 1 root root 88648 Apr 17 14:12 kmod_22-1ubuntu5_amd64.deb
-rw-r--r-- 1 root root 20091708 Apr 17 14:12 kubeadm_1.9.3-00_amd64.deb
-rw-r--r-- 1 root root 10539730 Apr 17 14:12 kubectl_1.9.3-00_amd64.deb
-rw-r--r-- 1 root root 20454776 Apr 17 14:12 kubelet_1.9.3-00_amd64.deb
-rw-r--r-- 1 root root 5909628 Apr 17 14:12 kubernetes-cni_0.6.0-00_amd64.deb
-rw-r--r-- 1 root root 24248 Apr 17 14:12 libatm1_1%3a2.5.1-1.5_amd64.deb
-rw-r--r-- 1 root root 27230 Apr 17 14:12 libxtables11_1.6.0-2ubuntu3_amd64.deb
drwx------ 2 root root 4096 Apr 17 14:12 partial
-rw-r--r-- 1 root root 321050 Apr 17 14:12 socat_1.7.3.1-1_amd64.deb
-rw-r--r-- 1 root root 22988 Apr 17 14:12 tcpd_7.6.q-25_amd64.deb
linuxit
linuxkit pkg build
kube-dns
kube-proxy
etcd
kube-apiserver
...
docker save
docker save
docker save
docker save
docker save
k8s-images
kube-dns.tar
kube-proxy.tar
etcd.tar
kube-apiserver.tar
...
gcr.io/google_containers/kube-proxy-amd64:v1.9.3@sha256:19277373ca983423c3ff82dbb14f079a2f37b84926a4c569375314fa39a4ee96
gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.7@sha256:f80f5f9328107dc516d67f7b70054354b9367d31d4946a3bffd3383d83d7efe8
gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.7@sha256:f5bddc71efe905f4e4b96f3ca346414be6d733610c1525b98fff808f93966680
gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.7@sha256:6cfb9f9c2756979013dbd3074e852c2d8ac99652570c5d17d152e0c0eb3321d6
gcr.io/google_containers/pause-amd64:3.0@sha256:163ac025575b775d1c0f9bf0bdd0f086883171eb475b5068e7defa4ca9e76516
weaveworks/weave-kube:2.2.0@sha256:a3f69d589e0b27b95070526e70de176811a3d2c6d9f07cc40c38c5fa7c026ff5
weaveworks/weave-npc:2.2.0@sha256:1d85c63e8b4cd433363d5527fdae263069d118308521490a9ea2d4b00b484a5e
brndnmtthws/nginx-echo-headers:latest@sha256:32dc6a6f408e8315622ee9fb8b4a6342d88df7d912f2075bb52929a16b33585a
gcr.io/google_containers/kube-apiserver-amd64:v1.9.3@sha256:a5382344aa373a90bc87d3baa4eda5402507e8df5b8bfbbad392c4fff715f043
gcr.io/google_containers/kube-controller-manager-amd64:v1.9.3@sha256:3ac295ae3e78af5c9f88164ae95097c2d7af03caddf067cb35599769d0b7251e
gcr.io/google_containers/kube-scheduler-amd64:v1.9.3@sha256:2c17e637c8e4f9202300bd5fc26bc98a7099f49559ca0a8921cf692ffd4a1675
gcr.io/google_containers/etcd-amd64:3.1.11@sha256:54889c08665d241e321ca5ce976b2df0f766794b698d53faf6b7dacb95316680
gcr.io/google_containers/kube-proxy-amd64:v1.9.3
@sha256:19277373ca983423c3ff82dbb14f079a2f37b84926a
4c569375314fa39a4ee96
FROM linuxkit/alpine:cba395fbc278daee841106801aba1e1bd7e0f2f7 AS build
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
RUN apk add --no-cache --initdb -p /out 
alpine-baselayout 
busybox
# Remove apk residuals. We have a read-only rootfs, so apk is of no use.
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
FROM scratch
WORKDIR /
COPY --from=build /out /
COPY --from=docker:17.06.0-ce /usr/local/bin/docker /usr/local/bin/docker
COPY dl/*.tar /images/
ENTRYPOINT [ "/bin/sh", "-c" ]
CMD [ "for image in /images/*.tar ; do docker image load -i $image && rm -f $image ; done" ]
FROM scratch
WORKDIR /
COPY --from=build /out /
COPY --from=docker:17.06.0-ce /usr/local/bin/docker /usr/local/bin/docker
COPY dl/*.tar /images/
ENTRYPOINT [ "/bin/sh", "-c" ]
CMD [ "for image in /images/*.tar ; do docker image load -i $image && rm -f $image ; done" ]
FROM scratch
WORKDIR /
COPY --from=build /out /
COPY --from=docker:17.06.0-ce /usr/local/bin/docker /usr/local/bin/docker
COPY dl/*.tar /images/
ENTRYPOINT [ "/bin/sh", "-c" ]
CMD [ "for image in /images/*.tar ; do docker image load -i $image && rm -f $image ; done" ]
kube-dns
kube-proxy
etcd
kube-apiserver
...
docker load
docker load
docker load
docker load
docker load
k8s-images
kube-dns.tar
kube-proxy.tar
etcd.tar
kube-apiserver.tar
...
$ docker run -v /var/run/docker.sock:/var/run/docker.sock 
gcr.io/replicated-equip/k8s-containers:v1.9.3
$ docker images
gcr.io/google_containers/kube-apiserver-amd64 v1.9.3 360d55f91cbf
gcr.io/google_containers/kube-controller-manager-amd64 v1.9.3 83dbda6ee810
gcr.io/google_containers/kube-proxy-amd64 latest 35fdc6da5fd8
gcr.io/google_containers/kube-proxy-amd64 v1.9.3 35fdc6da5fd8
gcr.io/google_containers/kube-scheduler-amd64 v1.9.3 d3534b539b76
weaveworks/weave-npc 2.2.0 765b48853ac0
weaveworks/weave-kube 2.2.0 222ab9e78a83
gcr.io/google_containers/etcd-amd64 3.1.11 59d36f27cceb
gcr.io/google_containers/k8s-dns-sidecar-amd64 1.14.7 db76ee297b85
gcr.io/google_containers/k8s-dns-kube-dns-amd64 1.14.7 5d049a8c4eec
gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64 1.14.7 5feec37454f4
gcr.io/google_containers/pause-amd64 3.0 99e59f495ffa
More than Applications: (Ab)using Docker to Improve the Portability of Everything
More than Applications: (Ab)using Docker to Improve the Portability of Everything
More than Applications: (Ab)using Docker to Improve the Portability of Everything
More than Applications: (Ab)using Docker to Improve the Portability of Everything
More than Applications: (Ab)using Docker to Improve the Portability of Everything
More than Applications: (Ab)using Docker to Improve the Portability of Everything

More than Applications: (Ab)using Docker to Improve the Portability of Everything