0

I get this error:

sudo docker run -d --name ipfs-node \
  -v /tmp/ipfs-docker-staging:/export -v /tmp/ipfs-docker-data:/data/ipfs \
  -v /home/ubuntu/.ipfs/config:/data/ipfs/config \
  -p 8080:8080 -p 4001:4001 -p 127.0.0.1:5001:5001 \
   jbenet/go-ipfs:latest 

ee613bda861afb7af65a2e9ba414f4421f76e232fcc4e10aee835038143372ca docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\"/home/ubuntu/.ipfs/config\\" to rootfs \\"/var/snap/docker/common/var-lib-docker/aufs/mnt/79b6c9331582b87d40683c784347974cf77a978cddb4e6cc04804bf856563236\\" at \\"/var/snap/docker/common/var-lib-docker/aufs/mnt/79b6c9331582b87d40683c784347974cf77a978cddb4e6cc04804bf856563236/data/ipfs/config\\" caused \\"not a directory\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

yellowsir
  • 741
  • 1
  • 9
  • 27
Trevor Oakley
  • 438
  • 5
  • 17

1 Answers1

0

Use --mount for standalone files:

sudo docker run -d --name ipfs-node \
  -v /tmp/ipfs-docker-staging:/export -v /tmp/ipfs-docker-data:/data/ipfs \
  --mount type=bind,source=/home/ubuntu/.ipfs/config,target=/data/ipfs/config \
  --net=host \
   ipfs/go-ipfs:release

Here is why: https://docs.docker.com/storage/bind-mounts/#differences-between--v-and---mount-behavior

PS. use official Docker images from ipfs/go-ipfs:release

PS2. use host interfaces via --net=host unless you really need NAT provided by Docker

lidel
  • 525
  • 3
  • 7