Publishing on a IPFS docker container

I’ve followed the documentation on https://hub.docker.com/r/jbenet/go-ipfs/#docker-usage and have managed to add the files I want and could access them from the localhost+hash url. I’m having difficulty running the name publish command to publish the file publicly. Below are the commands in which I’ve tried.

  • docker exec ID ipfs name publish QmfUAkhaGYZ9BGVNdAxvByXwFp7sRF6y4sgkMSo9nnpQ2m
  • docker exec ID ipfs name publish /export/QmfUAkhaGYZ9BGVNdAxvByXwFp7sRF6y4sgkMSo9nnpQ2m

The error I am getting is this: Error: invalid ‘ipfs ref’ path

TLDR: ipfs name publish --help and docker exec --help might help

You mught want to use -it and the full IPFS path:

docker exec -it ID ipfs name publish /ipfs/QmfUAkhaGYZ9BGVNdAxvByXwFp7sRF6y4sgkMSo9nnpQ2m