Failure while doing setup with Existing docker container

I can’t seem to set up a server with an existing docker container. I get an error from Maven that, as usual, tells me nothing about the problem.

sup:~$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
afc0c15d83f7        mysql:5.6           "docker-entrypoint.s…"   45 hours ago        Up 43 minutes>3306/tcp   openmrs-sdk-mysql-v3-2
What port would you like your server to use? (default: '8080'): 8001

If you want to enable remote debugging by default when running the server, 
specify the port number here (e.g. 1044). Leave blank to disable debugging. 
(Do not do this on a production server) (default: 'no debugging'): 

Which database would you like to use?:
1) MySQL 5.6 (requires pre-installed MySQL 5.6)
2) MySQL 5.6 in SDK docker container (requires pre-installed Docker)
3) Existing docker container (requires pre-installed Docker)

Which one do you choose? [1/2/3]: 3

Please specify your container id/name/label (you can get it using command `docker ps -a`): openmrs-sdk-mysql-v3-2

Please specify DB username: root

Please specify DB password: <redacted, but it's bad that this is echoed in the terminal in the first place>

Starting 'openmrs-sdk-mysql-v3-2' DB docker container...

The full debug output is at .

What am I doing wrong here? Does the container need to be stopped? Do I need to refer to it by ID, despite the prompt saying that name is ok?

@mseaton ?

I tried it with the Container ID and found out that despite the prompt saying “Please specify your container id/name/label”, this isn’t actually an ok way to refer to containers:

Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to find the 'afc0c15d83f7' container. Run 'docker ps' to see available containers.

do you have laguna database your connecting too arleady created?

No. Should I? The SDK handles the database setup for both of the other two options (installed MySQL, new MySQL docker container). It would be very surprising if it didn’t for this one.

1 Like

Am going to pick some time and try testing out this!!

Ok, I think option (3) in the setup just doesn’t work. Fortunately, option (2) actually does what option (3) says it’s supposed to do when there is an existing MySQL container: when such a container already exists, it reuses it. So dockerized MySQL users should just always specify option

2) MySQL 5.6 in SDK docker container (requires pre-installed Docker)