Skip to content

Instantly share code, notes, and snippets.

@MiLk
Created April 2, 2015 07:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiLk/1222ab288348a6a14a2b to your computer and use it in GitHub Desktop.
Save MiLk/1222ab288348a6a14a2b to your computer and use it in GitHub Desktop.
docker -> marathon
{
"id": "/dev.marathon.comapny.tld",
"args": ["yourcommand"],
"cpus": 0.1,
"mem": 64.0,
"instances": 1,
"container": {
"type": "DOCKER",
"docker": {
"image": "registry.company.tld/company/dev",
"network": "BRIDGE",
"portMappings": [
{ "containerPort": 80, "hostPort": 0, "servicePort": 0, "protocol": "tcp" }
]
}
}
}
IMAGE_NAME = company/dev
REGISTRY = registry.company.tld
MARATHON_URL = http://marathon.company.tld:8080
.PHONY: build push
build:
docker build -t "${IMAGE_NAME}" .
docker tag \
-f $(shell docker inspect --format='{{.Id}}' ${IMAGE_NAME}) \
${REGISTRY}/${IMAGE_NAME}
push: build
docker push ${REGISTRY}/${IMAGE_NAME}
curl -s -XPOST \
${MARATHON_URL}/v2/apps \
-H "Content-Type: application/json" \
-d @docker_dev.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment