0

I'm trying to use Traefik with a Jenkins container, but it does not work.

This is my docker-compose.yml:

version: '2'

services:
  jenkins:
    image: bitnami/jenkins:latest
#    ports:
#      - '20010:8080'
#      - '443:8443'
    environment:
      JENKINS_USERNAME: "user"
      JENKINS_PASSWORD: "jenkins18"
    labels:
      - traefik.port=8080
      - traefik.frontend.rule=Host:jenkins.mydomain.com
      - traefik.docker.network=traefik
      - traefik.frontend.passHostHeader=true
    volumes:
    - ./jenkins_data:/bitnami
    - jenkins-local-data:/jenkins/logs
    - jenkins-local-data:/jenkins/tmp
    links:
    - traefik

  traefik:
    image: traefik:latest
    command: -c /dev/null --web --web.address=:8686 --docker --logLevel=INFO
    ports:
    - '8686:8686'
    - '8080:8080'
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock

volumes:
  jenkins-local-data:
    driver: local

Going on: http://jenkins.mydomain.com he does not answer anything (jenkins.mydomain.com is present in the host file).

  • 1
    Several issues I'm seeing at first glance. You have a network configured for traefik that is not configured on the container. You're also publishing 8080 and 8686, but connecting to 80. – BMitch Sep 4 '18 at 18:15
  • the problem of the network is because I was wrong to copy the script here. however, jenkins uses port 8080 inside the container, not 80 – BOES Sep 4 '18 at 19:12
  • jenkins.mydomain.com tells your browser to go to port 80. – BMitch Sep 4 '18 at 19:13
  • You tell traefik to use a network named traefik, but do not attach the container to that network: traefik.docker.network=traefik – BMitch Sep 4 '18 at 19:16
  • @BMitch, yes sorry. I removed it. Works with port 80. How come? Does Traefik put everything on the 80? THZ ! – BOES Sep 4 '18 at 19:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.