Last active
January 8, 2019 21:48
-
-
Save slamdev/bab1f26f3a53651069e493d4c256a8be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: dind-sample | |
data: | |
Dockerfile: | | |
FROM alpine | |
RUN apk update --no-cache && apk add --no-cache bash | |
run.sh: | | |
#!/bin/sh | |
for i in $(seq 1 50); do | |
echo "### begin step ${i} ###" | |
docker build --no-cache --rm . | |
echo "### end step ${i} ###" | |
done | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: dind-sample | |
spec: | |
containers: | |
- name: dind | |
image: docker:dind | |
command: | |
- dockerd-entrypoint.sh | |
- --storage-driver=overlay2 | |
- --experimental | |
securityContext: | |
privileged: true | |
- name: runner | |
image: docker:stable | |
command: | |
- ./run.sh | |
securityContext: | |
privileged: true | |
workingDir: /opt | |
env: | |
- name: DOCKER_HOST | |
value: tcp://localhost:2375 | |
volumeMounts: | |
- name: files | |
mountPath: /opt | |
restartPolicy: Never | |
volumes: | |
- name: files | |
configMap: | |
defaultMode: 0777 | |
name: dind-sample |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl apply -f dind-sample.yaml | |
kubectl describe pod dind-sample | |
kubectl logs dind-sample -c runner | |
kubectl delete pod dind-sample | |
kubectl delete configmap dind-sample |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment