Confluence Docker image stuck on setup
Asked by Alexis Robert:

Hi,

I am trying to migrate my current Confluence Server instance to Docker. I want to keep using my current database, so I'm running the container with the following command line :

```
docker run -v /opt/confluence_home:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 -e ATL_DB_TYPE=mssql -e ATL_JDBC_USER=confluence -e ATL_JDBC_PASSWORD=xxx -e 'ATL_JDBC_URL=jdbc:sqlserver://myip:1433;databaseName=confluence' atlassian/confluence-server:6.13.3
```

However, this always starts the Confluence setup process, when I'm expecting it to use the current data in the database.

I have used the Jira and Bitbucket Docker previously images with exactly the same expectations (passing database information to Docker) and in both cases it just starts and does not take me to a setup screen.

Is this normal behaviour for Confluence ?

Thanks,

--Alexis


Answers:
author: Dave Chevell
body: Hey [@Alexis Robert](/t5/user/viewprofilepage/user-id/1213386) ,

When you pass DB configuration to our Confluence docker image, it will dynamically generate a **confluence.cfg.xml** file inside **$CONFLUENCE_HOME** containing this configuration, that Confluence will then use.

*However* , if there's an *existing* **confluence.cfg.xml** file inside **$CONFLUENCE_HOME** , we *won't*overwrite it for safety reasons - it's only intended to supply configuration to a new installation.

That being the case, I'd recommend that you check the contents of **/opt/confluence_home** on your host machine. Do you already have a copy of **confluence.cfg.xml**there? If so, Confluence will simply continue using this. If this were a new install I'd say just rename it to something else and retry; however if this is an existing instance there may be other critical configuration stored inside this file so you might be safest ensuring the existing configuration is correct.

I hope that helps Alexis!

Dave

comments: author: Alexis Robert
body: Hi [@Dave Chevell](/t5/user/viewprofilepage/user-id/792201) ,

thanks for the quick answer ! I actually tried passing these DB arguments with an empty confluence_home folder, and it was not created on startup (whereas this was working fine with the other Docker images for Jira and Bitbucket).

The only workaround was, as you said, having an existing **confluence.cfg.xml**in the target confluence_home folder.

Is it possible that it's a bug for the Confluence Docker image ?

Thanks,

--Alexis


author: Dave Chevell
body: Are you by any chance using an old version of the image? If I pull **atlassian/confluence-server** (any tag) I cant reproduce this - **confluence.cfg.xml** gets created.   

If you can supply an example of the exact **docker run** command you're using I can try it out and see if something is amiss!


author: Alexis Robert
body: Hi [@Dave Chevell](/t5/user/viewprofilepage/user-id/792201) ,

I tried with both **6.13.3** and **7.3.4** images from the official docker repo. Here's my **docker run** command :

```
docker run -v /opt/confluence_home:/var/atlassian/application-data/confluence --name="confluence" --user 1001 -d -p 8090:8090 -p 8091:8091 -e ATL_DB_TYPE=mssql -e ATL_JDBC_USER=confluence -e ATL_JDBC_PASSWORD=xxx -e 'ATL_JDBC_URL=jdbc:sqlserver://xxx:1433;databaseName=confluence' atlassian/confluence-server:6.13.3
```

The database settings passed to Docker are correct because Confluence setup won't show me the database settings page and skip right to the License setup page.

The /opt/confluence_home directory is empty when I'm running this of course.

Thanks for your help !

--Alexis


Tags: confluence-server

docker

server