--add-host example doesn't work as shown
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
In the documentation at https://github.com/docker/cli/blob/master/docs/reference/commandline/container_run.md#add-host, a python3 web server is run to server the hello file.
However, as shown, the command will run in the foreground and the user will be unable to run the rest of the commands in the same terminal session. If the user presses ctrl-c to terminate python to be able to run the container, the example won't work since the web server isn't running.
My own solution was to run python3 in the background by adding & to the command. However then I needed to kill the web server after running the container. Getting the pid and killing python isn't very elegant. Hopefully you can come up with a better solution.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the --add-host section in docs/reference/commandline/container_run.md and run the documented python3 web-server command alongside the container commands. Update the example so the server remains available while the commands run in the same terminal session and the instructions explain how the example is finished cleanly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- cli, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100