-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Swarm v1.13 with Docker Compose Format v3 #145
Comments
+1 Experiencing the same problem.. Your trial works fine, maybe this one is worth a pull-request since no one seems to have an alternative solution? |
@Hermsi1337 I can also confirm this works well with latest docker version 1.13.0 :) |
Sorry for bothering @JrCs ... what do you think about this? |
Hi, I'm still not able to get the simple setup (2 containers) running in Docker Swarm v1.13. I'd be happy if anyone could help me out. I'm not sure if I need to specify the full volumes with same path in the letsencrypt-nginx-proxy-companion service, or just the name (I'm a little confused by the new volume-syntax to be honest). Here my stack config:
|
@mantenpanther I'm having the same problem as you. Very confused about the new volume syntax as well. Were you able to find a solution at all? |
@mantenpanther @mbaig25 What image are you currently using? |
I've tried the docker-letsencrypt-nginx-proxy-companion and as you can see from my stack config the banian/letsencrypt images. |
@mantenpanther The problem is you are missing version: '3'
services:
proxy:
image: banian/nginx-proxy
deploy:
placement:
constraints:
- node.hostname==master_node_hostname_important
labels:
- NGINX_PROXY_SWARM_CONTAINER=true
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /data/local/nginx/vhost.d:/etc/nginx/vhost.d
- /data/local/nginx/html:/usr/share/nginx/html
- /data/local/certs:/etc/nginx/certs
- /data/local/nginx/nginx_log:/var/log/nginx
ports: ["80:80","443:443"]
networks: [edge]
restart: always
letsencrypt:
image: banian/letsencrypt
deploy:
placement:
constraints:
- node.hostname==node2
environment:
- NGINX_PROXY_SWARM_CONTAINER=true
#- DEBUG=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /data/local/nginx/vhost.d:/etc/nginx/vhost.d
- /data/local/nginx/html:/usr/share/nginx/html
- /data/local/certs:/etc/nginx/certs
- /data/local/nginx/nginx_log:/var/log/nginx
restart: always
networks:
edge:
external: true
|
@pi0 Thanks for responding. I tried the config you provided but the letsencrypt image fails with the following error message:
Here is my compose file version: '3'
services:
nginx:
image: jwilder/nginx-proxy
networks:
- proxy
ports:
- "80:80"
- "443:443"
labels:
- NGINX_PROXY_SWARM_CONTAINER=true
volumes:
- /etc/nginx/certs:/etc/nginx/certs:ro
- /etc/nginx/vhost.d:/etc/nginx/vhost.d
- /usr/share/nginx/html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
deploy:
placement:
constraints:
- node.role==manager
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
networks:
- proxy
labels:
- NGINX_PROXY_SWARM_CONTAINER=true
depends_on:
- nginx
volumes:
- /etc/nginx/certs:/etc/nginx/certs:rw
- /etc/nginx/vhost.d:/etc/nginx/vhost.d
- /usr/share/nginx/html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
deploy:
placement:
constraints:
- node.role==manager Any ideas what could be causing this? |
@mbaig25 Please note that this feature is not merged to this repo! So you have to (temporary) use patched image |
@pi0 Thanks for your answers, but still no luck for me. Containers do not start (tried on different hosts/docker engines; tried your file and the fixed one from mbaig25). I think I'll check again when this Issue is solved, can't spend more time ATM. |
@pi0 I tried your suggested image and I'm still getting the same error. I used the following command to try it: docker service create --name letsencrypt-companion \
-l NGINX_PROXY_SWARM_CONTAINER=true \
--network proxy \
--mount "type=bind,source=/etc/nginx/certs,target=/etc/nginx/certs" \
--mount "type=bind,source=/etc/nginx/vhost.d,target=/etc/nginx/vhost.d" \
--mount "type=bind,source=/usr/share/nginx/html,target=/usr/share/nginx/html" \
--mount "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" \
--constraint 'node.role == manager' \
banian/letsencrypt I started Still no luck. 😕 |
As i don't support docker-swarm, docker-compose and other tools to start the container, i think the best is to use a dedicated variable like in PR #126 to force the id of the nginx proxy container. |
This has been supported since #181 😄 |
Hi,
I am trying to get letsencrypt-nginx-proxy-companion to work with the latest docker swarm/compose
Unfortunately volumes_from can not be used with stacks
And it doesn't look like NGINX_PROXY_CONTAINER=**** can be used, as container_name cant be set either
I am working on a way to dynamically look up the containerId from a label
Set up the containers like this
And then lookup the containerId in entrypoint.sh like this
This seems to work:
However then i get hit by #144, so can't confirm if this fully works
Is there a better way to do this?
The text was updated successfully, but these errors were encountered: