apiVersion: v1 
kind: Pod 
metadata:
  name: hostpath-volume-docker-pod
spec: 
  containers: 
  - name: docker 
    image: docker 
    command: ["sleep"] 
    args: ["100000"]
    volumeMounts: 
    - name: docker-socket 
      mountPath: /var/run/docker.sock 
  volumes: 
  - name: docker-socket 
    hostPath:
      path: /var/run/docker.sock
      type: Socket

# Once Pod is created you can shell into it to run Docker commands:
# kubectl exec [pod-name] -it sh
