OCR-D/ocrd_all

"I have no name!" in prompt after logging in to container

Closed this issue · 2 comments

Logging in to a container in Docker, the prompt displays: I have no name!@ade9a4692fcd:/data$
(not affecting any functionality, just a confusing warning/placeholder here)

@kba suggested to fix this so it does not confuse users (cf. https://github.com/OCR-D/ocrd-website/pull/353/files#r1198902403)

What prompt would you suggest? Prompts can be constructed from any text (for example a simple $ ), include the user's name (which is undefined here), the machine name (which is a random string here), the current working directory, but also date and time in any format and other things could be included.

Personally I'd omit the user and machine name because both are not relevant for a docker container and either use the very minimalistic prompt or one which shows the current working directory.

kba commented

@bertsky proposed

We could, but it is helpful to see the user name in the prompt (esp. whether you are root). But since the default PS1 also uses \$ (which is $ for non-root and # for root), I guess we can simply drop \u – yes.

Since we do not set the hostname and the default hostname indeed appears random - I thought it was somehow related to the hash of the container but that does not appear to be the case, if anybody knows the algorithm for default hostname in Docker, please chime in - I think PS1='\w \$' would be best, i.e. current working directory and either $ (normal user) or # (root).