diff --git a/stacks/dockercoins.yml b/compose/dockercoins/docker-compose.yml similarity index 100% rename from stacks/dockercoins.yml rename to compose/dockercoins/docker-compose.yml diff --git a/compose/dockercoins/dockercoins b/compose/dockercoins/dockercoins new file mode 120000 index 00000000..bfd3cbd6 --- /dev/null +++ b/compose/dockercoins/dockercoins @@ -0,0 +1 @@ +../../dockercoins/ \ No newline at end of file diff --git a/stacks/dockercoins+gelf.yml b/compose/dockercoins/stack-with-gelf.yml similarity index 100% rename from stacks/dockercoins+gelf.yml rename to compose/dockercoins/stack-with-gelf.yml diff --git a/stacks/dockercoins+healthcheck.yml b/compose/dockercoins/stack-with-healthcheck.yml similarity index 100% rename from stacks/dockercoins+healthcheck.yml rename to compose/dockercoins/stack-with-healthcheck.yml diff --git a/efk/README.md b/compose/efk/README.md similarity index 100% rename from efk/README.md rename to compose/efk/README.md diff --git a/efk/docker-compose.yml b/compose/efk/docker-compose.yml similarity index 100% rename from efk/docker-compose.yml rename to compose/efk/docker-compose.yml diff --git a/efk/fluentd/Dockerfile b/compose/efk/fluentd/Dockerfile similarity index 100% rename from efk/fluentd/Dockerfile rename to compose/efk/fluentd/Dockerfile diff --git a/efk/fluentd/fluentd.conf b/compose/efk/fluentd/fluentd.conf similarity index 100% rename from efk/fluentd/fluentd.conf rename to compose/efk/fluentd/fluentd.conf diff --git a/elk/docker-compose.yml b/compose/elk/docker-compose.yml similarity index 99% rename from elk/docker-compose.yml rename to compose/elk/docker-compose.yml index e77b97ac..ac32f73a 100644 --- a/elk/docker-compose.yml +++ b/compose/elk/docker-compose.yml @@ -1,4 +1,4 @@ -version: "2" +version: "3" services: elasticsearch: diff --git a/elk/logstash.conf b/compose/elk/logstash.conf similarity index 100% rename from elk/logstash.conf rename to compose/elk/logstash.conf diff --git a/stacks/portainer.yml b/compose/portainer/docker-compose.yml similarity index 100% rename from stacks/portainer.yml rename to compose/portainer/docker-compose.yml diff --git a/prom/Dockerfile b/compose/prometheus/Dockerfile similarity index 100% rename from prom/Dockerfile rename to compose/prometheus/Dockerfile diff --git a/stacks/prometheus.yml b/compose/prometheus/docker-compose.yml similarity index 96% rename from stacks/prometheus.yml rename to compose/prometheus/docker-compose.yml index c0dc8922..b41f8fdb 100644 --- a/stacks/prometheus.yml +++ b/compose/prometheus/docker-compose.yml @@ -3,7 +3,7 @@ version: "3" services: prometheus: - build: ../prom + build: . image: 127.0.0.1:5000/prom ports: - "9090:9090" diff --git a/prom/prometheus.yml b/compose/prometheus/prometheus.yml similarity index 100% rename from prom/prometheus.yml rename to compose/prometheus/prometheus.yml diff --git a/stacks/prometheus+config.yml b/compose/prometheus/stack-with-config.yml similarity index 95% rename from stacks/prometheus+config.yml rename to compose/prometheus/stack-with-config.yml index 20088c31..449c0b03 100644 --- a/stacks/prometheus+config.yml +++ b/compose/prometheus/stack-with-config.yml @@ -32,4 +32,4 @@ services: configs: prometheus: - file: ../prom/prometheus.yml + file: ./prometheus.yml diff --git a/stacks/registry.yml b/compose/registry/docker-compose.yml similarity index 100% rename from stacks/registry.yml rename to compose/registry/docker-compose.yml diff --git a/stacks/visualizer.yml b/compose/visualizer/docker-compose.yml similarity index 100% rename from stacks/visualizer.yml rename to compose/visualizer/docker-compose.yml diff --git a/slides/containers/Logging.md b/slides/containers/Logging.md index aac4172f..71077c9e 100644 --- a/slides/containers/Logging.md +++ b/slides/containers/Logging.md @@ -199,6 +199,7 @@ will have equal success with Fluent or other logging stacks!* ```bash $ git clone https://github.com/jpetazzo/container.training $ cd container.training +$ cd compose $ cd elk $ docker-compose up ``` diff --git a/slides/k8s/buildshiprun-selfhosted.md b/slides/k8s/buildshiprun-selfhosted.md index 000dd4f4..288cc997 100644 --- a/slides/k8s/buildshiprun-selfhosted.md +++ b/slides/k8s/buildshiprun-selfhosted.md @@ -145,22 +145,22 @@ The curl command should now output: .exercise[ -- Go to the `stacks` directory: +- Go to this directory: ```bash - cd ~/container.training/stacks + cd ~/container.training/compose/dockercoins ``` - Build and push the images: ```bash export REGISTRY export TAG=v0.1 - docker-compose -f dockercoins.yml build - docker-compose -f dockercoins.yml push + docker-compose build + docker-compose push ``` ] -Let's have a look at the `dockercoins.yml` file while this is building and pushing. +Let's have a look at the `docker-compose.yml` file while this is building and pushing. --- diff --git a/slides/k8s/rollout.md b/slides/k8s/rollout.md index 5783c020..4b31252a 100644 --- a/slides/k8s/rollout.md +++ b/slides/k8s/rollout.md @@ -71,7 +71,7 @@ If you are using images from the Docker Hub (`dockercoins/worker:v0.1`), skip th .exercise[ -- Go to the `stacks` directory (`~/container.training/stacks`) +- Go to the directory `~/container.training/compose/dockercoins`) - Edit `dockercoins/worker/worker.py`; update the first `sleep` line to sleep 1 second @@ -79,8 +79,8 @@ If you are using images from the Docker Hub (`dockercoins/worker:v0.1`), skip th ```bash #export REGISTRY=localhost:3xxxx export TAG=v0.2 - docker-compose -f dockercoins.yml build - docker-compose -f dockercoins.yml push + docker-compose build + docker-compose push ``` ] diff --git a/slides/swarm/firstservice.md b/slides/swarm/firstservice.md index 7bf8f1b1..5034a680 100644 --- a/slides/swarm/firstservice.md +++ b/slides/swarm/firstservice.md @@ -441,11 +441,11 @@ class: extra-details - Run this simple-yet-beautiful visualization app: ```bash - cd ~/container.training/stacks - docker-compose -f visualizer.yml up -d + cd ~/container.training/compose/visualizer + docker-compose up -d ``` - + ] diff --git a/slides/swarm/gui.md b/slides/swarm/gui.md index 78b7bcbe..d1c8c0b7 100644 --- a/slides/swarm/gui.md +++ b/slides/swarm/gui.md @@ -18,14 +18,14 @@ What about web interfaces to control and manage Swarm? .exercise[ -- Make sure we are in the stacks directory: +- Make sure we are in the right directory: ```bash - cd ~/container.training/stacks + cd ~/container.training/compose/portainer ``` - Deploy the Portainer stack: ```bash - docker stack deploy -c portainer.yml portainer + docker stack deploy -c docker-compose.yml portainer ``` ] diff --git a/slides/swarm/healthchecks.md b/slides/swarm/healthchecks.md index c13570f1..ca2311f2 100644 --- a/slides/swarm/healthchecks.md +++ b/slides/swarm/healthchecks.md @@ -89,7 +89,10 @@ docker service update \ ## Implementing auto-rollback in practice -We will use the following Compose file (`stacks/dockercoins+healthcheck.yml`): +We will use the following Compose file, +
+`compose/dockercoins/stack-with-healthcheck.yml`: + ```yaml ... @@ -117,14 +120,14 @@ We need to update our services with a healthcheck. .exercise[ -- Go to the `stacks` directory: +- Go to the directory: ```bash - cd ~/container.training/stacks + cd ~/container.training/compose/dockercoins ``` - Deploy the updated stack with healthchecks built-in: ```bash - docker stack deploy --compose-file dockercoins+healthcheck.yml dockercoins + docker stack deploy --compose-file stack-with-healthcheck.yml dockercoins ``` ] @@ -149,8 +152,8 @@ We need to update our services with a healthcheck. - Build, ship, and run the new image: ```bash export TAG=v0.3 - docker-compose -f dockercoins+healthcheck.yml build - docker-compose -f dockercoins+healthcheck.yml push + docker-compose build + docker-compose push docker service update --image=127.0.0.1:5000/hasher:$TAG dockercoins_hasher ``` diff --git a/slides/swarm/logging.md b/slides/swarm/logging.md index 975949ed..0f43f59b 100644 --- a/slides/swarm/logging.md +++ b/slides/swarm/logging.md @@ -185,17 +185,17 @@ class: elk-auto - Build, ship, and run our ELK stack: ```bash - docker-compose -f elk.yml build - docker-compose -f elk.yml push - docker stack deploy -c elk.yml elk + cd ~/container.training/compose/elk + docker stack deploy -c docker-compose.yml elk ``` ] -Note: the *build* and *push* steps are not strictly necessary, but they don't hurt! +Note: we didn't need the *build* and *push* steps here, since +we are only using images from the Docker Hub. Let's have a look at the [Compose file]( -https://@@GITREPO@@/blob/master/stacks/elk.yml). +https://@@GITREPO@@/blob/master/compose/elk/docker-compose.yml). --- diff --git a/slides/swarm/metrics.md b/slides/swarm/metrics.md index 120feb85..e0279047 100644 --- a/slides/swarm/metrics.md +++ b/slides/swarm/metrics.md @@ -1153,16 +1153,16 @@ class: prom-auto .exercise[ -- Make sure we are in the stacks directory: +- Go to the directory of the Prometheus stack: ```bash - cd ~/container.training/stacks + cd ~/container.training/compose/prometheus ``` - Build, ship, and run the Prometheus stack: ```bash - docker-compose -f prometheus.yml build - docker-compose -f prometheus.yml push - docker stack deploy -c prometheus.yml prometheus + docker-compose build + docker-compose push + docker stack deploy -c docker-compose.yml prometheus ``` ] @@ -1237,7 +1237,7 @@ class: prom-auto, config ## Deploying Prometheus with a `config` -The following Compose file (`prometheus+config.yml`) achieves +The following Compose file (`stack-with-config.yml`) achieves the same result, but by using a `config` instead of baking the configuration into the image. @@ -1259,7 +1259,7 @@ prometheus: configs: prometheus: - file: ../prom/prometheus.yml + file: ./prometheus.yml ``` ] @@ -1291,13 +1291,13 @@ class: prom-auto, config ## Re-deploying Prometheus with a config -- We will update the existing stack using `prometheus+config.yml` +- We will update the existing stack using `stack-with-config.yml` .exercise[ - Redeploy the `prometheus` stack: ```bash - docker stack deploy -c prometheus+config.yml prometheus + docker stack deploy -c stack-with-config.yml prometheus ``` - Check that Prometheus still works as intended diff --git a/slides/swarm/operatingswarm.md b/slides/swarm/operatingswarm.md index c66d503e..d9fbd51e 100644 --- a/slides/swarm/operatingswarm.md +++ b/slides/swarm/operatingswarm.md @@ -34,11 +34,12 @@ for N in $(seq 2 5); do DOCKER_HOST=tcp://node$N:2375 docker swarm join --token $TOKEN node1:2377 done git clone https://@@GITREPO@@ -cd container.training/stacks -docker stack deploy --compose-file registry.yml registry -docker-compose -f dockercoins.yml build -docker-compose -f dockercoins.yml push -docker stack deploy --compose-file dockercoins.yml dockercoins +cd container.training/compose/registry +docker stack deploy --compose-file docker-compose.yml registry +cd container.training/compose/dockercoins +docker-compose build +docker-compose push +docker stack deploy --compose-file docker-compose.yml dockercoins ``` You should now be able to connect to port 8000 and see the DockerCoins web UI. diff --git a/slides/swarm/stacks.md b/slides/swarm/stacks.md index bd6049bb..13257d9f 100644 --- a/slides/swarm/stacks.md +++ b/slides/swarm/stacks.md @@ -66,7 +66,7 @@ Without a stack file, it would be deployed with the following command: docker service create --publish 5000:5000 registry ``` -Now, we are going to deploy it with the following stack file: +Now, we are going to deploy it with the following Compose file: ```yaml version: "3" @@ -80,20 +80,22 @@ services: --- -## Checking our stack files +## Checking our Compose file -- All the stack files that we will use are in the `stacks` directory +- The Compose file for the registry is in its own directory + + (like the other Compose files that we will use) .exercise[ -- Go to the `stacks` directory: +- Go to the `compose/registry` directory: ```bash - cd ~/container.training/stacks + cd ~/container.training/compose/registry ``` -- Check `registry.yml`: +- Check the Compose file: ```bash - cat registry.yml + cat docker-compose.yml ``` ] @@ -114,7 +116,7 @@ services: - Deploy our local registry: ```bash - docker stack deploy --compose-file registry.yml registry + docker stack deploy --compose-file docker-compose.yml registry ``` ] @@ -263,13 +265,14 @@ The curl command should now output: - Try it: ```bash - docker-compose -f dockercoins.yml build - docker-compose -f dockercoins.yml push + cd ~/container.training/compose/dockercoins + docker-compose build + docker-compose push ``` ] -Let's have a look at the `dockercoins.yml` file while this is building and pushing. +Let's have a look at the `docker-compose.yml` file while this is building and pushing. --- @@ -304,7 +307,7 @@ services: - Create the application stack: ```bash - docker stack deploy --compose-file dockercoins.yml dockercoins + docker stack deploy --compose-file docker-compose.yml dockercoins ``` ] diff --git a/stacks/dockercoins b/stacks/dockercoins deleted file mode 120000 index 8adbb1b5..00000000 --- a/stacks/dockercoins +++ /dev/null @@ -1 +0,0 @@ -../dockercoins \ No newline at end of file diff --git a/stacks/elk.yml b/stacks/elk.yml deleted file mode 100644 index ce1edab4..00000000 --- a/stacks/elk.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: "3" - -services: - elasticsearch: - image: elasticsearch:2 - - logstash: - image: logstash:2 - command: | - -e ' - input { - gelf { } - heartbeat { } - } - filter { - ruby { - code => " - event.to_hash.keys.each { |k| event[ k.gsub('"'.'"','"'_'"') ] = event.remove(k) if k.include?'"'.'"' } - " - } - } - output { - elasticsearch { - hosts => ["elasticsearch:9200"] - } - stdout { - codec => rubydebug - } - }' - - ports: - - "12201:12201/udp" - - kibana: - image: kibana:4 - ports: - - "5601:5601" - environment: - ELASTICSEARCH_URL: http://elasticsearch:9200 -