docker run vs docker-compose - different results? I have just started exploring Docker and am having trouble with docker commit/-compose.
I have copied a file into /root/.guacamole/lib (in the container) and then created an image using docker commit.
An ls of the relevant path in the container using
docker run -it --name=&quot;name&quot; image bash

confirms that the file exists, but when the following docker-compose file sets up the container, the file is missing, even though it reports using the same image.
Any idea why that should be?
Thanks
$ cat docker-compose.yml
version: &quot;2&quot;
services:
  guacd:
    image: &quot;guacamole/guacd&quot;
    container_name: guacd
    hostname: guacd
    restart: always
    volumes:
      - &quot;/data/shared/guacamole/guacd/data:/data&quot;
      - &quot;/data/shared/guacamole/guacd/conf:/conf:ro&quot;
    expose:
      - &quot;4822&quot;
    ports:
      - &quot;4822:4822&quot;
    network_mode: bridge

  guac2:
    image: &quot;guac2&quot;
    container_name: guac2
    hostname: guac2
    restart: always
    volumes:
      - &quot;/data/shared/guacamole/guacamole/guac-home:/data&quot;
      - &quot;/data/shared/guacamole/guacamole/conf:/conf:ro&quot;
    expose:
      - &quot;8080&quot;
    ports:
      - &quot;8084:8080&quot;
    network_mode: bridge
    environment:
      - &quot;GUACD_HOSTNAME=pc.lan&quot;
      - &quot;GUACD_PORT=4822&quot;
      - &quot;MYSQL_HOSTNAME=pc.lan&quot;
      - &quot;MYSQL_PORT=3306&quot;
      - &quot;MYSQL_DATABASE=guacamole_db&quot;
      - &quot;MYSQL_USER=guacamole_user&quot;
      - &quot;MYSQL_PASSWORD=password&quot;
      - &quot;GUACAMOLE_HOME=/data&quot;

Here is the terminal text:
user@pc:~$ docker run -it --name=&quot;test&quot; guac2 bash
root@b6dcd7dda985:/opt/guacamole# cd /root/.g*/lib
root@b6dcd7dda985:~/.guacamole/lib# ls
mariadb-java-client-2.6.2.jar  mysql-connector-java-5.1.46-bin.jar  mysql-connector-java-5.1.46.jar
***[NB 3 files listed above]***
root@b6dcd7dda985:~/.guacamole/lib# exit
exit
user@pc:~$ docker stop test
test
user@pc:~$ docker rm test
test
user@pc:~$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
ea92c2db77f6        guac2               &quot;/opt/guacamole/bin/…&quot;   51 minutes ago      Up 51 minutes       0.0.0.0:8084-&gt;8080/tcp   guac2
52aea98f7e2c        guacamole/guacd     &quot;/bin/sh -c '/usr/lo…&quot;   About an hour ago   Up 57 minutes       0.0.0.0:4822-&gt;4822/tcp   guacd
user@pc:~$ docker stop guacd
guacd
user@pc:~$ docker stop guac2
guac2
user@pc:~$ docker rm guacd
guacd
user@pc:~$ docker rm guac2
guac2
user@pc:~$ docker-compose up -d
Creating guac2 ... done
Creating guacd ... done
user@pc:~$ docker exec -it guac2 bash
root@guac2:/opt/guacamole# cd /root/.g*/lib
root@guac2:~/.guacamole/lib# ls
mysql-connector-java-5.1.46-bin.jar  mysql-connector-java-5.1.46.jar
***[NB only 2 files listed above]***
root@guac2:~/.guacamole/lib# exit
I'm a bit new to Docker as well, but are you 100% certain that you performed a Docker push and your commit of your docker image that you're building with composer? And you have matching versions on the remote and your local machine?
I'm also not seeing where you are mounting the '~/.guacamole/lib' path in your docker-compose.yml under volumes: