Skip to content

Instantly share code, notes, and snippets.

@liejuntao001
Last active October 21, 2019 20:52
Show Gist options
  • Save liejuntao001/19b0f08a034c9866af8311144d8e7689 to your computer and use it in GitHub Desktop.
Save liejuntao001/19b0f08a034c9866af8311144d8e7689 to your computer and use it in GitHub Desktop.
# this is a template to do docker build in Kubernetes
# Refer to my article https://medium.com/swlh/fast-docker-build-in-kubernetes-f52088854f45
apiVersion: v1
kind: Pod
metadata:
name: docker-build
spec:
volumes:
- name: dind-storage
emptyDir: {}
containers:
- name: docker
image: docker:19.03.3-git
command:
- cat
tty: true
env:
- name: DOCKER_HOST
value: tcp://localhost:2375
- name: dind
image: docker:19.03.3-dind
# alternatively use dind with git
# image: baibai/docker:19.03.3-dind-git
securityContext:
privileged: true
env:
- name: DOCKER_TLS_CERTDIR
value: ''
# Adjust the mtu value according to Kubernetes networking condition
#args:
#- "--mtu=1440"
volumeMounts:
- name: dind-storage
mountPath: /var/lib/docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment