Skip to content

Instantly share code, notes, and snippets.

@slamdev
Last active January 8, 2019 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slamdev/bab1f26f3a53651069e493d4c256a8be to your computer and use it in GitHub Desktop.
Save slamdev/bab1f26f3a53651069e493d4c256a8be to your computer and use it in GitHub Desktop.
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
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