I have this pod definition:
apiVersion: v1
kind: Pod
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 998 # Group ID of docker group on the node
containers:
- name: someconainter
image: someimage
resources:
requests:
memory: "8G"
cpu: "6"
limits:
memory: "10G"
cpu: "8"
imagePullPolicy: Always
tty: true
command:
- cat
volumeMounts:
- mountPath: /var/run
name: docker-sock
volumes:
- name: docker-sock
hostPath:
path: /var/run
In which I've mounted the Docker socket from the node to the pod, as you can see.
Then from within the pod I try to do docker run command like this:
docker run --rm -v ${helmChartFolder}:/chart:ro ubuntu ls -lah
Then the mounted /chart
folder is completely empty although on the pod itself it's not
So what could be the reason for this, I kept trying tweaking the -v
args and even tried --mount
with no luck so far.