I am trying to deploy a few docker containers on a DC/OS. I was successfully able to deploy a simple docker container. But I need to deploy a container with some additional parameters attached to it. Like attaching a directory like a volume and setting some environment variable. In docker, it is achieved by running the following command.
sudo docker run --name nifi-ssl \
-v /home/azureuser/docker_nifi/nifi_stores:/opt/certs \
-p 8443:8443 \
-e NIFI_WEB_PROXY_HOST="some dns":8443 \
-e AUTH=tls \
-e KEYSTORE_PATH=/opt/certs/keystore.jks \
-e KEYSTORE_TYPE=JKS \
-e KEYSTORE_PASSWORD="somevalue" \
-e TRUSTSTORE_PATH=/opt/certs/truststore.jks \
-e TRUSTSTORE_PASSWORD="somevalue" \
-e TRUSTSTORE_TYPE=JKS \
-e INITIAL_ADMIN_IDENTITY='CN=sys_admin, OU=NIFI' \
-d \
apache/nifi:latest
I need to set these kinda parameters in the marathon definition that I create for deploying the container. A marathon app definition for a simple container is as follows.
{
"id": "nifi",
"container": {
"type": "DOCKER",
"docker": {
"image": "apache/nifi:latest"
},
"portMappings": [
{ "hostPort": 8080, "containerPort": 8080, "protocol": "tcp" }
]
},
"networks": [
{
"mode": "container/bridge"
}
],
"acceptedResourceRoles": ["slave_public"],
"instances": 1,
"cpus": 0.1,
"mem": 5120
}
My question is how do I translate the above docker command to the marathon app definition so that when I deploy it, the resultant container is like what I would get if I ran the docker command