Giter Site home page Giter Site logo

/bin/sh not working about whoami HOT 8 CLOSED

traefik avatar traefik commented on August 22, 2024
/bin/sh not working

from whoami.

Comments (8)

ldez avatar ldez commented on August 22, 2024 1

yes, the users files must be inside the Traefik container.

from whoami.

ldez avatar ldez commented on August 22, 2024

Hello,

the whoami container is based on a FROM SCRATCH image, so there is no shell.

from whoami.

PackElend avatar PackElend commented on August 22, 2024

thx for the quick question but could you explain in more detail.

I'm a bit lost with the whoami image.
According to whoami's dockerfile is build FROM SCRATCH using golang:1-Alpine what is the latest stable images according to golang simple tags.
On top of this to go modules are installed go.mod and go.sum, that's it.
In Image Variants, it is said that is on the popular Alpine Linux project, available in the alpine official image.

Everywhere is said that Alpine comes with /bash/sh:

This assumption is challenged by

 "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "EXPOSE 80"
            ],

in the whoami image.

I reckon the explanation is given in:

but I don't fully get it. Besides this, they also mentioned there, that Alpine comes with /bin/sh.

Moreover, I don't find anything that would indicate that Cmd in the image gets overridden as mentioned in linux - Starting a shell in the Docker Alpine container - Stack Overflow.

Last but not least, I'm still sure that I could start a shell once in the whoami container but I cannot remember how and this is driving me nuts.
May I don't see the woods for the tree but some help is welcome.

BACKGROUND

I want to mount BasicAuth - Traefik usersFile in the container but I get occasionally the error message that the file cannot be found.
Without a shell, I can hardly troubleshoot.

from whoami.

ldez avatar ldez commented on August 22, 2024
  1. The whoami Dockerfile is a multistage build file:
  • stage 1: build the binary
  • stage 2: build the image

https://github.com/containous/whoami/blob/9bf5b44f24ad03c76e9f7b632736795f5314902a/Dockerfile#L19

  1. The whoami image is not related to the traefik image

  2. The file used by the basic auth must be in the Traefik container.

from whoami.

PackElend avatar PackElend commented on August 22, 2024
1. The whoami image is not related to the traefik image

that is clear

2\. The file used by the basic auth must be in the Traefik container.

but I want to add BasicAuth to whoami what works when I do

- traefik.http.middlewares.whoami_auth.basicauth.users=user:$$2y$$15$$GP95en

what may made traefik/traefik#4791 (comment) even worse.

from whoami.

ldez avatar ldez commented on August 22, 2024

usersFile and users are not the same thing:

  • usersFile reference a file in the Traefik container
  • users is just a string.

from whoami.

PackElend avatar PackElend commented on August 22, 2024

usersFile reference a file in the Traefik container

I assumed it references to a file in the labelled container.
So if I would like to use unique usersFile per container managed by Traefik, each file has to be mounted into the Traefik container, hasn't it?

from whoami.

PackElend avatar PackElend commented on August 22, 2024

the docs may be improved to make this clearer 😃

from whoami.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.