From 306b9e9bb769283a5dfabf1ff742de23c62bdf9c Mon Sep 17 00:00:00 2001 From: James Lee Date: Sun, 26 Jun 2016 15:13:05 +0100 Subject: [PATCH 01/16] refactor docker compose file --- common.yml | 7 +++++++ docker-compose.yml | 9 ++++++--- prod.yml | 9 ++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 common.yml diff --git a/common.yml b/common.yml new file mode 100644 index 00000000..99579bb3 --- /dev/null +++ b/common.yml @@ -0,0 +1,7 @@ +version: '2' +services: + dockerapp: + ports: + - "5000:5000" + redis: + image: redis:3.2.0 diff --git a/docker-compose.yml b/docker-compose.yml index 2c57eda6..8b6b1188 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,12 @@ version: '2' services: dockerapp: + extends: + file: common.yml + service: dockerapp build: . - ports: - - "5000:5000" redis: - image: redis:3.2.0 + extends: + file: common.yml + service: redis diff --git a/prod.yml b/prod.yml index b0096ff1..877b5bd2 100644 --- a/prod.yml +++ b/prod.yml @@ -1,9 +1,12 @@ version: '2' services: dockerapp: + extends: + file: common.yml + service: dockerapp image: jleetutorial/dockerapp - ports: - - "5000:5000" redis: - image: redis:3.2.0 + extends: + file: common.yml + service: redis From 8bddaa60639ba9d789b0821a134e70474ee0bbe5 Mon Sep 17 00:00:00 2001 From: James Lee Date: Mon, 27 Jun 2016 22:34:52 +0100 Subject: [PATCH 02/16] update docker compose file for docker swarm --- prod.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/prod.yml b/prod.yml index 877b5bd2..7e54684e 100644 --- a/prod.yml +++ b/prod.yml @@ -5,8 +5,20 @@ services: file: common.yml service: dockerapp image: jleetutorial/dockerapp + environment: + - constraint:node==master + depends_on: + - redis + networks: + - mynet redis: extends: file: common.yml service: redis + networks: + - mynet + +networks: + mynet: + driver: overlay From e6f0a7a497497b7f6dc4f50ac74e1052de5e3a69 Mon Sep 17 00:00:00 2001 From: jleetutorial Date: Wed, 28 Dec 2016 02:52:48 +0000 Subject: [PATCH 03/16] Create README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..c459f5c3 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# dockerapp +Project source code for https://www.udemy.com/docker-tutorial-for-devops-run-docker-containers From 1a803b68b7d3e6e26f8f0d7c66f7e56989302c4e Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Tue, 7 Feb 2017 14:05:14 -0500 Subject: [PATCH 04/16] dummy commit to test ci build --- dummy.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 dummy.txt diff --git a/dummy.txt b/dummy.txt new file mode 100644 index 00000000..e69de29b From be277a81d7df7aca94e7555df725843b1ef05c7e Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Tue, 7 Feb 2017 14:19:11 -0500 Subject: [PATCH 05/16] dummy commit to test ci build with version --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index b0b8a79a..f30654b4 100644 --- a/circle.yml +++ b/circle.yml @@ -1,3 +1,4 @@ +version: '2' machine: pre: - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 From 536678daabc0f4a3a2aa33c9de42f0b72c47ddd9 Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Tue, 7 Feb 2017 14:44:18 -0500 Subject: [PATCH 06/16] dummy commit to test ci build with version --- circle.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/circle.yml b/circle.yml index f30654b4..b0b8a79a 100644 --- a/circle.yml +++ b/circle.yml @@ -1,4 +1,3 @@ -version: '2' machine: pre: - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 From 3a7ad53bc1f082cafa0e9298838a5573d7379556 Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 11:36:26 -0500 Subject: [PATCH 07/16] dummy commit to test ci build with version 0.3 --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index b0b8a79a..1765c77a 100644 --- a/circle.yml +++ b/circle.yml @@ -6,9 +6,9 @@ machine: dependencies: pre: - - sudo pip install docker-compose + - sudo pip install docker-compose==1.8.1 test: override: - docker-compose up -d - - docker-compose run dockerapp python test.py + - docker-compose run dockerapp-1 python test.py From 82d154e2f434522cb96cb863b5cd02c2ba610aae Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 11:41:38 -0500 Subject: [PATCH 08/16] dummy commit to test ci build with version 0.4 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ca8326e1..e9c824c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ version: '2' services: - dockerapp: + dockerapp-1: build: . ports: - "5000:5000" From b9da8e7856d4cf7be2eeaf1afa5db733dde63169 Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 14:42:44 -0500 Subject: [PATCH 09/16] Update circle.yml --- circle.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/circle.yml b/circle.yml index 1fcba97c..5e08a539 100644 --- a/circle.yml +++ b/circle.yml @@ -19,8 +19,8 @@ deployment: branch: /.*/ commands: - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD - - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp:$CIRCLE_SHA1 - - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp:latest - - docker push $DOCKER_HUB_USER_ID/dockerapp:$CIRCLE_SHA1 - - docker push $DOCKER_HUB_USER_ID/dockerapp:latest + - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 + - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp-1:latest + - docker push $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 + - docker push $DOCKER_HUB_USER_ID/dockerapp-1:latest From 4ef16e0e6f55914275f0a7cf2d1103c3a2bcd171 Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 14:59:51 -0500 Subject: [PATCH 10/16] Removed tag sets Removed tag sets because we don't know how to change put the image id into the pull request yet. --- circle.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/circle.yml b/circle.yml index 5e08a539..56176cea 100644 --- a/circle.yml +++ b/circle.yml @@ -19,8 +19,6 @@ deployment: branch: /.*/ commands: - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD - - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - - docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp-1:latest - docker push $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - docker push $DOCKER_HUB_USER_ID/dockerapp-1:latest From af93d2251fa3d942c9e5c2a16efcb90370f50f52 Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 15:07:33 -0500 Subject: [PATCH 11/16] Setting for Docker Hub #1 --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 56176cea..076e3e38 100644 --- a/circle.yml +++ b/circle.yml @@ -19,6 +19,6 @@ deployment: branch: /.*/ commands: - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD - - docker push $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - - docker push $DOCKER_HUB_USER_ID/dockerapp-1:latest + - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 + - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:latest From 41deaf3ac20217d6b9aa34e0a5e0b4236cb0e7ac Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 15:24:53 -0500 Subject: [PATCH 12/16] Changed tag for image id Added the image id to the tag set rather than repository name --- circle.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/circle.yml b/circle.yml index 076e3e38..f21c2441 100644 --- a/circle.yml +++ b/circle.yml @@ -19,6 +19,8 @@ deployment: branch: /.*/ commands: - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD + - docker tag b4e8a1cda8f7 $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 + - docker tag b4e8a1cda8f7 $DOCKER_HUB_USER_ID/dockerapp-1:latest - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:latest From 3a36aea9e849866d08ccbbea88400a3fb1eab8ed Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 15:30:05 -0500 Subject: [PATCH 13/16] Update circle.yml --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index f21c2441..aea77040 100644 --- a/circle.yml +++ b/circle.yml @@ -19,6 +19,7 @@ deployment: branch: /.*/ commands: - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD + - docker images - docker tag b4e8a1cda8f7 $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - docker tag b4e8a1cda8f7 $DOCKER_HUB_USER_ID/dockerapp-1:latest - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 From 6a7da896b2684b9019061819a40991467967594f Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 15:35:26 -0500 Subject: [PATCH 14/16] Updated image info --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index aea77040..cb1eae30 100644 --- a/circle.yml +++ b/circle.yml @@ -20,8 +20,8 @@ deployment: commands: - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD - docker images - - docker tag b4e8a1cda8f7 $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - - docker tag b4e8a1cda8f7 $DOCKER_HUB_USER_ID/dockerapp-1:latest + - docker tag a81b55a84fdf $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 + - docker tag a81b55a84fdf $DOCKER_HUB_USER_ID/dockerapp-1:latest - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:latest From aa278fd3cfe9cfbc13dafd431ec17a6501cb3b52 Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 15:40:24 -0500 Subject: [PATCH 15/16] Update circle.yml --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index cb1eae30..47030754 100644 --- a/circle.yml +++ b/circle.yml @@ -20,8 +20,8 @@ deployment: commands: - docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD - docker images - - docker tag a81b55a84fdf $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - - docker tag a81b55a84fdf $DOCKER_HUB_USER_ID/dockerapp-1:latest + - docker tag dockerapp1_dockerapp-1 $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 + - docker tag dockerapp1_dockerapp-1 $DOCKER_HUB_USER_ID/dockerapp-1:latest - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:latest From e19e94689aa90c5a3ee4c9f9d687c82eef9ea098 Mon Sep 17 00:00:00 2001 From: lazyitdude Date: Mon, 13 Feb 2017 15:46:17 -0500 Subject: [PATCH 16/16] Update circle.yml --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 47030754..d87d86a9 100644 --- a/circle.yml +++ b/circle.yml @@ -22,6 +22,6 @@ deployment: - docker images - docker tag dockerapp1_dockerapp-1 $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - docker tag dockerapp1_dockerapp-1 $DOCKER_HUB_USER_ID/dockerapp-1:latest - - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 - - docker push https://hub.docker.com/r/$DOCKER_HUB_USER_ID/dockerapp-1:latest + - docker push $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1 + - docker push $DOCKER_HUB_USER_ID/dockerapp-1:latest