apiVersion: v1
kind: Pod
metadata:
  name: init-container
spec:
  initContainers:
  - name: content
    image: busybox
    command:
    - "sh"
    - "-c"
    - echo 'Welcome from Packt' > /work-dir/index.html
    volumeMounts:
    - name: workdir
      mountPath: "/work-dir"
  containers:
  - name: server
    image: nginx
    ports:
    - containerPort: 80
    volumeMounts:
    - name: workdir
      mountPath: /usr/share/nginx/html
  volumes:
  - name: workdir
    emptyDir: {}