Docker Community Forums

Share and learn in the Docker community.

Deploying Docker image to Azure App Services

Hi
I have been trying to deploy the Redmine Docker image to Azure managed service called App Services. The service offers a wizard where you select different options related to azure infrastructure and Docker image. Based on user choices, behind the scenes it builds the docker run command e.g.
docker run -d -p 4170:3000 --name slssredmine_0_747b9118 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=slssredmine -e WEBSITE_AUTH_ENABLED=False -e PORT=3000 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=slssredmine.azurewebsites.net -e WEBSITE_INSTANCE_ID=1c59f5fc0b50e5b164b3836ebf18e1e9ab9b55995e116ce531a7d55c29cc3ef0 redmine

The problem is that I need to add additional environment variables that tells redmine which database it needs to connect to. App Services wizard offers a “Startup Command” field - a command that will be run as part of application startup. I have tried to add my additional environment variables there:

export REDMINE_DB_MYSQL=51.140.184.12 REDMINE_DB_PORT=3306 REDMINE_DB_USERNAME=special@mysqlredmine REDMINE_DB_PASSWORD=special!

but it looks that whatever I put there is appended to the end of run command:

docker run -d -p 4170:3000 --name slssredmine_0_747b9118 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=slssredmine -e WEBSITE_AUTH_ENABLED=False -e PORT=3000 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=slssredmine.azurewebsites.net -e WEBSITE_INSTANCE_ID=1c59f5fc0b50e5b164b3836ebf18e1e9ab9b55995e116ce531a7d55c29cc3ef0 redmine export REDMINE_DB_MYSQL=51.140.184.12 REDMINE_DB_PORT=3306 REDMINE_DB_USERNAME=special@mysqlredmine REDMINE_DB_PASSWORD=special!

Has anyone experience this issue. Is there a workaround for this. Any help would be much appreciated.
I am new to Docker and Linux so I apologise if I am doing something silly here.

UPDATE:
I just had a look at docker run command reference:

$ docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG…]

It looks that Startup Command in the Azure App Services wizard populates the [COMMAND] section of the docker run command.

is there a way to set my environment variables there? In the Redmine docker image reference on docker hub, setting database environment variables is part of [OPTIONS] section which I do not have access to because it is built by the App Service behind the scenes.

Regards
Kanalia