Skip to content
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

Unable to create router for some containers #6534

Closed
TheTrigger opened this issue Mar 20, 2020 · 2 comments
Closed

Unable to create router for some containers #6534

TheTrigger opened this issue Mar 20, 2020 · 2 comments

Comments

@TheTrigger
Copy link

TheTrigger commented Mar 20, 2020

Do you want to request a feature or report a bug?

Bug

What did you do?

Creating a new container through docker-compose.
I tried to create the container "manually" from portainer, but same behavior.

broken:

  workify:
    image: "registry.gitlab.com/thetrigger/workify-backend:latest"

working:

  workify:
    image: "containous/whoami"

labels:

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.workify-backend.rule=Host(`be.workify.ncs.oibi.dev`)"
      - "traefik.http.routers.workify-backend.tls=true"
      - "traefik.http.routers.workify-backend.tls.certresolver=le"

The problem seems triggered by the image from ASP.NET Core 3 (tried with ubuntu and alpine)
I tried with another software that's based on 2.2 and it's working.

Simple 3.1 Dockerfile (not working)

# Stage 1
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /build

EXPOSE 80
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release -o /app
# Stage 2
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS final
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "Workify.dll"]

Working 2.2:

FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 80

[ .. omitted ..]

FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build

[ .. omitted ..]

What did you expect to see?

  • Working router and https certificates
  • image

What did you see instead?

  • No http router and no certificates

Output of traefik version: 2.1

docker: Docker version 19.03.5, build 633a0ea838
Traefik: 2.1.8

What is your environment & configuration (arguments, toml, provider, platform, ...)?

version: "3.3"

services:

  traefik:
    image: "traefik:v2.1"
    container_name: "traefik"
    command:
      - "--log.level=DEBUG"
      - "--api.dashboard=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--providers.docker.network=traefik2_default"
      - "--entrypoints.web.address=:80"
      - "--entryPoints.websecure.address=:443"
      - "--certificatesResolvers.le.acme.email=-omitted-"
      - "--certificatesResolvers.le.acme.storage=/etc/traefik/acme/acme.json"
      - "--certificatesresolvers.le.acme.tlschallenge=true"
      - "--certificatesResolvers.le.acme.httpChallenge.entryPoint=web"
      - "--certificatesResolvers.le.acme.dnsChallenge=true"
      - "--accesslog=true"
      - "--accesslog.filepath=/logs/access.log"
      - "--accesslog.bufferingsize=100"
    networks:
      - traefik2_default
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/opt/traefik2/configuration/:/configuration/"
      - "/opt/traefik2/acme:/etc/traefik/acme" # chmod 600 acme
      - "/opt/traefik2/logs:/logs/"
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik2_default"
      - "traefik.http.routers.api.rule=Host(`traefik.oibi.dev`)"
      - "traefik.http.routers.api.tls=true"
      - "traefik.http.routers.api.tls.certresolver=le"
      - "traefik.http.routers.api.service=api@internal"
      - "traefik.http.routers.api.middlewares=dashboardBasicAuth"
      - "traefik.http.middlewares.dashboardBasicAuth.basicauth.users=-omitted-"
      # ANY HTTP to HTTPS redirect
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
      - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:[a-z-.]+}`)"

networks:
  traefik2_default:
    external: true

If applicable, please paste the log output in DEBUG level (--log.level=DEBUG switch)

since route is ignored:

time="2020-03-20T16:56:31Z" level=debug msg="Serving default certificate for request: \"be.workify.ncs.oibi.dev\""
@traefiker
Copy link
Contributor

Hi! I'm Træfiker 🤖 the bot in charge of communication regulation.

Thanks for your interest in Traefik!

We dedicate the issue tracker to bug reports and feature requests only. My advanced AI has spotted that your issue might be a configuration problem or relates to something that doesn't look like a bug.

To confirm this, please join our Community Forum and reach out to us on the Traefik section.

In case I'm wrong (well, that would be embarrassing 😅), my developers will re-open the issue and fix me!

In the meantime, you can double check Traefik's documentation.

@TheTrigger
Copy link
Author

TheTrigger commented Mar 20, 2020

It's not a configuration problem @SantoDE @jbdoumenjou @rtribotte
Sorry for the inconvenience but I have to unlock the situation. I am deploying some applications, a new one and others are updates, it is a blocking problem

@traefik traefik locked and limited conversation to collaborators Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants