I've noticed problems with the configuration of Docker volumes binding on Ubuntu 22.04 LTS, installed from an ISO file downloaded from the official site: https://ubuntu.com/download/server.
The commands below can reproduce the problem.
Create a new directory with 777 access and a test file:
mkdir /tmp/ngdatachmod 777 /tmp/ngdatatouch /tmp/ngdata/created_on_host
Next, I run a Docker container with volume binding:
docker run -v /tmp/ngdata:/ngdata:rw -d nginx
This command:
docker exec 7dfa35882407 ls /ngdata
returns nothing. Executing touch from within the container creates a file within the container:
docker exec <conainer hash> touch /ngdata/created_on_dockerdocker exec <conainer hash> ls /ngdata
The second command returns: created_on_docker.
Running ls /tmp/ngdata on the host returns created_on_host.
It looks like there are problems with binding; the container stores files on its own file system, which is not bound to the host.
I have encountered this problem on at least two computers with Ubuntu 22.04 LTS, but on a Linode node running Ubuntu 22.04, everything works without the aforementioned issue.
Could you please guide me on what I can check to resolve the volume binding issue on my Ubuntu servers?