How to mount volume without using docker

258 Views Asked by At

In order to mount a directory to a container i used bind mounts https://docs.docker.com/storage/bind-mounts/ Now i'm trying to find a way to replace $docker run -v command.

1

There are 1 best solutions below

1
On

If you are using kubernetes as that is there in your tag. You can mount a volume as hostpath.

In Pod spec:

  volumeMounts:
    - name: config
      mountPath: <PATH IN CONTAINER>
  volumes:
    - name: config
      hostPath:
        path: <YOUR LOCAL DIR PATH>

Check out https://kubernetes.io/docs/concepts/storage/volumes/ for more details