docker-swarm

What's the difference between docker restart_policy on-failure vs any

自作多情 提交于 2020-07-30 07:05:08
问题 In the docker swarm v3 docs, there are 3 different restart policy conditions that can be used. It's obvious what the none condition does, but I was wondering what the difference between on-failure and any is specifically. Here's a picture from the docs: 回答1: The on-failure policy handles any time a container exist with a non-zero code. The any policy covers any other scenarios, but may only be handled on daemon restart depending on how the container was stopped (e.g. intentionally stopping a

Traefik + Consul not generaitng SSL certificates in replicated mode, using TRAEFIK DEFAULT CERT

为君一笑 提交于 2020-07-21 10:26:04
问题 I have a setup of 1 master and 2 worker nodes running docker swarm. I deployed Traefik + Consul using the setup below: version: '3.3' services: consul-leader: image: consul:latest command: - agent - -server - -client=0.0.0.0 - -bootstrap - -ui environment: CONSUL_BIND_INTERFACE: eth0 CONSUL_LOCAL_CONFIG: '{"leave_on_terminate": true}' volumes: - consul-data-leader:/consul/data networks: - default - traefik-public logging: driver: json-file deploy: labels: traefik.tags: traefik-public traefik

Traefik + Consul not generaitng SSL certificates in replicated mode, using TRAEFIK DEFAULT CERT

天大地大妈咪最大 提交于 2020-07-21 10:25:39
问题 I have a setup of 1 master and 2 worker nodes running docker swarm. I deployed Traefik + Consul using the setup below: version: '3.3' services: consul-leader: image: consul:latest command: - agent - -server - -client=0.0.0.0 - -bootstrap - -ui environment: CONSUL_BIND_INTERFACE: eth0 CONSUL_LOCAL_CONFIG: '{"leave_on_terminate": true}' volumes: - consul-data-leader:/consul/data networks: - default - traefik-public logging: driver: json-file deploy: labels: traefik.tags: traefik-public traefik

Traefik + Consul not generaitng SSL certificates in replicated mode, using TRAEFIK DEFAULT CERT

╄→尐↘猪︶ㄣ 提交于 2020-07-21 10:25:25
问题 I have a setup of 1 master and 2 worker nodes running docker swarm. I deployed Traefik + Consul using the setup below: version: '3.3' services: consul-leader: image: consul:latest command: - agent - -server - -client=0.0.0.0 - -bootstrap - -ui environment: CONSUL_BIND_INTERFACE: eth0 CONSUL_LOCAL_CONFIG: '{"leave_on_terminate": true}' volumes: - consul-data-leader:/consul/data networks: - default - traefik-public logging: driver: json-file deploy: labels: traefik.tags: traefik-public traefik

Traefik v2: 404 while routing HTTP traffic globally to HTTPS

自古美人都是妖i 提交于 2020-07-20 10:34:28
问题 I have the problem that I can route HTTPS traffic but I can not globally redirect the HTTP traffic to HTTPS. In my case I only want HTTPS traffic, so that I want to redirect all the incoming traffic. Currently I get an 404 error while I try to serve my URLs over HTTP. I already enabled DEBUG logs in Treafik, but I can not see any problems or unnormal stuff in the logs. Additionally I saw a pretty similar topic here on Stackoverflow, but we found out, that his error was not the same to mine:

Traefik v2: 404 while routing HTTP traffic globally to HTTPS

荒凉一梦 提交于 2020-07-20 10:34:00
问题 I have the problem that I can route HTTPS traffic but I can not globally redirect the HTTP traffic to HTTPS. In my case I only want HTTPS traffic, so that I want to redirect all the incoming traffic. Currently I get an 404 error while I try to serve my URLs over HTTP. I already enabled DEBUG logs in Treafik, but I can not see any problems or unnormal stuff in the logs. Additionally I saw a pretty similar topic here on Stackoverflow, but we found out, that his error was not the same to mine:

How to set hostname in global service in Docker Swarm

夙愿已清 提交于 2020-07-19 04:26:19
问题 I have a service deployed to my Docker Swarm Cluster as global service (ELK Metricbeat). I want to each of this service to have a hostname the same as the hostname of the running node (host)? in another word, how I can achieve the same result in the yml file such as: docker run -h `hostname` elastic/metricbeat:5.4.1 this is my yml file: metricbeat: image: elastic/metricbeat:5.4.1 command: metricbeat -e -c /etc/metricbeat/metricbeat.yml -system.hostfs=/hostfs hostname: '`hostname`' volumes: -

parse error: Invalid numeric literal at line 1, column 8 in script

大城市里の小女人 提交于 2020-07-10 06:58:07
问题 I'm getting above error in my shell script. My task is that I want to delete from my Docker Hub private repository tags which are older than 30 days. So here I have written a small script. After executing I'm getting a parse error. It has jq, echo and curl #!/bin/sh username=rashidmd password=xxxxxxxx HUB_TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'$username'", "password": "'$password'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) #echo $HUB

Run docker service on HTTPS

左心房为你撑大大i 提交于 2020-06-24 03:17:06
问题 Currently, I run a simple docker container by using the following files. DockerFile FROM microsoft/aspnet:4.7.1 WORKDIR /inetpub/wwwroot EXPOSE 80 COPY index.html . docker-compose.yml version: '3.4' services: testapp: image: mytestapp:${TAG:-latest} build: context: . dockerfile: Dockerfile docker-compose.override.yml version: '3.4' services: testapp: ports: - "9091:80" I use windows image to create my container by using the following command and I can access it by http://localhost:9091/.