Issues using the docker container

I had gotten this to work last week, but somehow I can’t get it working now. Through poking around in my local image I messed things up yesterday, nuked the directories and re cloned them down to my computer. Now i cant even get the openemr/openemr from the docker site to spin up.

I am using the docker-compose.yml file taken from openemr-devops/docker/openemr/5.0.0 at master · openemr/openemr-devops · GitHub

I am on windows 10, using docker through a VM. I am pasting the log at the bottom of this message. I saved that file in a directory and run the docker CLI and the command docker-compose up

The containers show up both on the CLI and in Kitematic, but http://192.168.99.100:80 is not working and when I connect to the SQL container, the openemr schema is not present. Last week, the schema was present and everything was fine. Is there something that I can check to see where the problem might be?

I am new to git, docker, php etc, but a long-time (ago) programmer in windows. Over the past few weeks I have learned a lot, but I am in past my knowledge and experience.

My long term goal is to get this running on Google infrastructure for my wife’s speech-language pathology practice, customize forms and allow remote reporting of session notes. I also was going to examine changing the accounting side of things, but that is for later on. After I understand how this stuff works, I will probably be hanging out in the developer side of things.

Thanks so much in advance,
Derek Hillison

link to log:
https://drive.google.com/open?id=1YiufbOEixdhW7aID-6EGGePrmx179zMX
link to docker-compose.yml:
https://drive.google.com/open?id=17fkeGnCFdHCK5foGdbDkJrD2RHUOzjud

hi @dhillison ,
What do you see with following command ‘docker ps -a’ ?
-brady

More information: It must be related to something on my machine. I can create a new folder, throw the docker-compose.yml into it and do docker-compose up once. If I do docker-compose down, then it won’t work again if I try to docker-compose up again. It has to be something with the VM, docker or something I am running on my computer.

I will continue thrashing my bull horns around in the terminal :slight_smile:

Let me know if anyone has any insight on this or has used the docker image on windows. I could go find a livecd but I would rather not have to.

Thanks,
Derek

Thanks brady, here is docker ps -a and an inspect of the containers.

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                         NAMES
e88dc4f60466        openemr/openemr     "./run_openemr.sh"       5 minutes ago       Up 5 minutes        0.0.0.0:80->80/tcp, 443/tcp   jjj_openemr_1
cfe3d9143885        mysql               "docker-entrypoint..."   5 minutes ago       Up 5 minutes        3306/tcp                      jjj_mysql_1

 docker inspect openemr/openemr
[
    {
        "Id": "sha256:1eaa3d977096bd0984f40ef8a17a86831eaa84f777cd0147b15c6f0b0dab6fb7",
        "RepoTags": [
            "openemr/openemr:latest"
        ],
        "RepoDigests": [
            "openemr/openemr@sha256:c4e63e79539b0a1389ff08337c1cbe275ecb5f5bac109c17dd3bbcabf7bbd549"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2017-12-18T10:08:44.03923283Z",
        "Container": "9d55b990571a1e2e1b22e39f6e003820054a816bb98974423284ac7fc31add10",
        "ContainerConfig": {
            "Hostname": "f4a99b2d7911",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "443/tcp": {},
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "APACHE_LOG_DIR=/var/log/apache2"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "EXPOSE 443/tcp 80/tcp"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:b8e66ab7b638639214ada839765f8a93e63a7a807acda9f20a46457a0b7a5f29",
            "Volumes": {
                "/etc/letsencrypt/": {},
                "/etc/ssl": {},
                "/var/www/localhost/htdocs/openemr/sites": {}
            },
            "WorkingDir": "/var/www/localhost/htdocs/openemr",
            "Entrypoint": null,
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "17.05.0-ce",
        "Author": "",
        "Config": {
            "Hostname": "f4a99b2d7911",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "443/tcp": {},
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "APACHE_LOG_DIR=/var/log/apache2"
            ],
            "Cmd": [
                "./run_openemr.sh"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:b8e66ab7b638639214ada839765f8a93e63a7a807acda9f20a46457a0b7a5f29",
            "Volumes": {
                "/etc/letsencrypt/": {},
                "/etc/ssl": {},
                "/var/www/localhost/htdocs/openemr/sites": {}
            },
            "WorkingDir": "/var/www/localhost/htdocs/openemr",
            "Entrypoint": null,
            "OnBuild": [],
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 697751052,
        "VirtualSize": 697751052,
        "GraphDriver": {
            "Data": null,
            "Name": "aufs"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:16174e87921f30e394dbcde33e3b9939b81c461bbb7b501dacec9869880f4297",
                "sha256:856a4aa19b0ef96a7dc55209a2379c4178be2f21e9deb5cf148925bdc283f90d",
                "sha256:d811802d2ffd1cb6626ef0c95501e4815d2a3934792d8e36745dd361b4225e3c",
                "sha256:2ace828a2b9d10f3febd238fd7f158b949b93a9bb46681fcd3371b28c3882744",
                "sha256:02c38883cd1fa00dd5801d1ba899999831766af7942689f6a026f8b0c29a3473",
                "sha256:4bf85a79d8969eba19ac21dc5e2a7d2f4f4413cabea492febce157c435a44579",
                "sha256:4e5e0e9796662acbf33c6dad6c9a7f058915988ba98ab61f76ddca7d7ed63881",
                "sha256:455696ac5e4c92806a7e2d8ef443657268aace518d45e79afc94d4a31199604a",
                "sha256:cc39c7d09f2618b61a53139f17dc0cf13970a691709074ddca9612b38f57fdb8"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

$ docker inspect mysql
[
    {
        "Id": "sha256:7d83a47ab2d2d0f803aa230fdac1c4e53d251bfafe9b7265a3777bcc95163755",
        "RepoTags": [
            "mysql:latest"
        ],
        "RepoDigests": [
            "mysql@sha256:1f95a2ba07ea2ee2800ec8ce3b5370ed4754b0a71d9d11c0c35c934e9708dcf1"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2017-12-12T02:25:59.577772537Z",
        "Container": "db89d092bfbc53541c7ea871538d855dcf6316905661866e086eec53dbad7225",
        "ContainerConfig": {
            "Hostname": "db89d092bfbc",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "3306/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.7",
                "MYSQL_MAJOR=5.7",
                "MYSQL_VERSION=5.7.20-1debian8"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "CMD [\"mysqld\"]"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:8720e7520d90cfb52665fe85a8ea0ac3c996ea5b4d97b14e1a49dda941a71aba",
            "Volumes": {
                "/var/lib/mysql": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "17.06.2-ce",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "3306/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "GOSU_VERSION=1.7",
                "MYSQL_MAJOR=5.7",
                "MYSQL_VERSION=5.7.20-1debian8"
            ],
            "Cmd": [
                "mysqld"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:8720e7520d90cfb52665fe85a8ea0ac3c996ea5b4d97b14e1a49dda941a71aba",
            "Volumes": {
                "/var/lib/mysql": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": [],
            "Labels": null
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 408180205,
        "VirtualSize": 408180205,
        "GraphDriver": {
            "Data": null,
            "Name": "aufs"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:4bcdffd70da292293d059d2435c7056711fab2655f8b74f48ad0abe042b63687",
                "sha256:ae12d30e1dfca970a5890a9eed9da78388df7cc8eec9032b6bfd58b273647dfb",
                "sha256:889744378e18b28083b2cf6e1f3afec05977a762b9c303e090098528e1ee194a",
                "sha256:19aa284e9bf37324b2da8fb6750a8f26b22cd83dbe1df2e5b755965a57946204",
                "sha256:8b2d012e71d9cb512ae5c4e6abafff1d2d605f953155d694edb842b89fb9f261",
                "sha256:45fb4a2ab5ebe8385f1f4ca16da9d50b5fcf3ff453b68e8df654dd11561e8bec",
                "sha256:a48e160acd118a981ae61657d7f3a965326e460003946a4aba8b62c43e209348",
                "sha256:918c72810d66465ab451f0679379da61aa4a7fa059a91836c4be7a7aaebd4675",
                "sha256:b12c2906d51a441bce98592819458cc699982053506ad5d2c0a556874287a556",
                "sha256:3f448b3ed34244d8200826f34dfc99da294274c207c67f20a8dfb410cfbe8526"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

hi @dhillison ,
To clarify what the VM is. Are you running this on a separate virtual machine that is using linux? Or is the VM meant to be something else?
Also, after you do the docker-compose up again(ie. when it breaks), what do you see with the command in terminal ‘docker ps -a’?
-brady

The VM downloaded with the windows version of docker, and it runs linux through Oracle Virtualbox. What I posted above is from when it breaks. Below is what it shows when i compose down, there is more content below the codebox

dhill@DESKTOP-DHVOB93 MINGW64 ~/dockerdev/jjj (master)
$ docker-compose down
Stopping jjj_openemr_1 ... done
Stopping jjj_mysql_1   ... done
Removing jjj_openemr_1 ... done
Removing jjj_mysql_1   ... done
Removing network jjj_default

dhill@DESKTOP-DHVOB93 MINGW64 ~/dockerdev/jjj (master)
$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Here is me doing a new run in a different folder with the same file:

$ docker-compose up -d
Creating network "wwww_default" with the default driver
Creating volume "wwww_sitevolume" with default driver
Creating volume "wwww_logvolume01" with default driver
Creating wwww_mysql_1 ...
Creating wwww_mysql_1 ... done
Creating wwww_openemr_1 ...
Creating wwww_openemr_1 ... done

and what docker ps -a shows when it works. Thanks again for your help with this.

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                         NAMES
5ff95dc06f2c        openemr/openemr     "./run_openemr.sh"       2 minutes ago       Up 2 minutes        0.0.0.0:80->80/tcp, 443/tcp   wwww_openemr_1
70d47cca89c3        mysql               "docker-entrypoint..."   2 minutes ago       Up 2 minutes        3306/tcp                      wwww_mysql_1

To confirm, the bottom ‘docker ps -a’ output is what you see after the second time you do docker-compose up when it no longer works?

the one running in the jjj folder(earlier post) was running for the second time, and did not work. I had previously run it once and it worked then. The one running in the wwww folder (later post) was running for the first time and it worked then.

The first time the containers are run, openemr builds all the necessary tables in mysql, right? The second run it should detect those as being present and start right up. Should I attach the docker logs for both mysql and openemr when they work and when they dont?

here is the process I went through

Create jjj folder
move docker-compose.yml file into folder
docker-compose up (containers show up and it works
docker compose down (it shows containers coming down ok
docker compose up (containers show up, but it doesn’t work)
docker compose down (shows containers coming down ok)

Create new folder, etc get it to run once.

I am sure this will be a pebcak problem or something related to the environment I am in. It has to be something simple that needs to be reset between runs or something.

this is my current docker-compose.yml. I added a line for the mysql ports to be exposed so I can see the db

# Use root/example as user/password credentials
version: '3.1'
services:
  mysql:
    restart: always
    image: mysql
    command: ['mysqld','--character-set-server=utf8']
    environment:
      MYSQL_ROOT_PASSWORD: root
    ports:
    - 3306:3306    
  openemr:
    restart: always
    image: openemr/openemr
    ports:
    - 80:80
    volumes:
    - logvolume01:/var/log
    - sitevolume:/var/www/localhost/htdocs/openemr/sites/default
    environment:
      MYSQL_HOST: mysql
      MYSQL_ROOT_PASS: root
      MYSQL_USER: root
      MYSQL_PASS: root
      OE_USER: admin
      OE_PASS: pass
    links:
    - mysql
volumes:
  logvolume01: {}
  sitevolume: {}

Thanks again,
Derek

Hi @dhillison ,

Been playing around with this a bit. It looks like ‘docker-compose down’ actually shuts down the containers and then removes them. But you are still left with the *_sitevolume. Then when you do ‘docker-compose up’ again it creates new containers, but likely does not work because the old /var/www/localhost/htdocs/openemr/sites/default/slqconf.php file in the prior volume shows that it is already installed(ie. setup does not happen). And since there is then not a database setup, when you try to go to login screen it will break. So, after doing ‘docker-compose down’, should do a docker volume rm of the pertinent sitevolume before trying to do ‘docker-compose up’ again.

It looks like when you go to another directory and run it, then the naming of the volume is different, which is why that worked.

-brady

Actually ‘docker-compose down -v’ will stop containers, remove containers, and remove volumes (-v does volumes). Then a ‘docker-compose up’ should work.
So, the above will basically delete everything and let you start again.

Below is some cool stuff that can do to stop/start etc. Here’s a sample docker-compose.yml build that also brings in phpmyadmin, which is pretty neat:

# admin/pass are default user/password credentials for openemr
# openemr is default mysql database
# openemr/openemr are default user/password credentials for mysql openemr database
version: '3.1'
services:
  mysql:
    restart: always
    image: mysql
    command: ['mysqld','--character-set-server=utf8']
    environment:
      MYSQL_ROOT_PASSWORD: root
  openemr:
    restart: always
    image: openemr/openemr
    ports:
    - 80:80
    - 443:443
    volumes:
    - logvolume01:/var/log
    - sitevolume:/var/www/localhost/htdocs/openemr/sites
    environment:
      MYSQL_HOST: mysql
      MYSQL_ROOT_PASS: root
    links:
    - mysql
  phpmyadmin:
    restart: always
    image: phpmyadmin/phpmyadmin
    ports:
    - 81:80
    environment:
      PMA_HOST: mysql
    links:
    - mysql
volumes:
  logvolume01: {}
  sitevolume: {}

ok, lets run docker-compose up in the background (just give it a couple minutes after run it):
docker-compose up -d
After a couple minutes, then openemr and phpmyadmin should be working fine.
Now, lets stop them all:
docker-compose stop
Now lets restart them all:
docker-compose start
Now openemr and phpmyadmin should be working
Now lets just stop phpmyadmin:
docker-compose stop phpmyadmin

-brady

This is AWESOME! I knew it had to be something simple to fix, even if it was complex to figure out.

Thank you so much!

I am able to get this working now. My next steps (will probably move to the developer side soon). I will be attempting to document this journey but I am not sure I will get it all down. I will provide back everything I do to the wiki.

  1. get the public image running on google infrastructure
  2. Get the public image copied to my docker account
  3. Run the public image from my docker account
  4. git the openemr project to my computer
  5. build the openemr image from my computer
  6. run this image in a container on my computer
  7. make changes to the openemr image
  8. run this changed image on my computer
  9. repeat 6 and 7 :slight_smile:

Thanks,
Derek

1 Like

Putting this here in case anyone wants to see more about this and how I followed up on what was suggested.
Thank you again, Brady!

to list all volumes: (I had lots and lots and lots)

docker volume ls

To clean up those volumes (and other stuff):

docker system prune -a
docker volume rm $(docker volume ls -f 'dangling=true')

from:
https://gist.github.com/bastman/5b57ddb3c11942094f8d0a97d461b430

1 Like