Skip to content

Commit

Permalink
Document .containerenv in manpages. Move it to /run.
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Heon <[email protected]>

Closes: #533
Approved by: baude
  • Loading branch information
mheon authored and rh-atomic-bot committed Mar 23, 2018
1 parent 75f9fdf commit 5fc5b4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/podman-run.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ If the IMAGE is not already loaded then **podman run** will pull the IMAGE, and
all image dependencies, from the repository in the same way running **podman
pull** IMAGE, before it starts the container from that image.

Several files will be automatically created within the container when it is run.
These include `/etc/hosts`, `/etc/hostname`, and `/etc/resolv.conf` to manage
networking. These will be based on the host's version of the files, though they
can be customized with options (for example, **--dns** will override the host's
DNS servers in the created `resolv.conf`). Additionally, an empty file is
created in each container to indicate to programs they are running in a
container. This file is located at `/run/.containerenv`.

## OPTIONS
**--add-host**=[]
Add a custom host-to-IP mapping (host:ip)
Expand Down
5 changes: 3 additions & 2 deletions libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,13 +673,14 @@ func (c *Container) makeBindMounts() error {
}

// Make .containerenv
if _, ok := c.state.BindMounts["/.containerenv"]; !ok {
// Empty file, so no need to recreate if it exists
if _, ok := c.state.BindMounts["/run/.containerenv"]; !ok {
// Empty string for now, but we may consider populating this later
containerenvPath, err := c.writeStringToRundir(".containerenv", "")
if err != nil {
return errors.Wrapf(err, "error creating containerenv file for container %s", c.ID())
}
c.state.BindMounts["/.containerenv"] = containerenvPath
c.state.BindMounts["/run/.containerenv"] = containerenvPath
}

return nil
Expand Down

0 comments on commit 5fc5b4e

Please sign in to comment.