Created
April 2, 2015 07:19
-
-
Save MiLk/1222ab288348a6a14a2b to your computer and use it in GitHub Desktop.
docker -> marathon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" } | |
] | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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