mirror of
https://github.com/containers/podman
synced 2024-10-21 17:53:44 +00:00
Add .containerenv file
This will allow programs to easily identify they are running in a container Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #533 Approved by: baude
This commit is contained in:
parent
6cf7ddbcfa
commit
75f9fdf21c
|
@ -672,6 +672,16 @@ func (c *Container) makeBindMounts() error {
|
|||
c.state.BindMounts["/etc/hostname"] = hostnamePath
|
||||
}
|
||||
|
||||
// Make .containerenv
|
||||
if _, ok := c.state.BindMounts["/.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
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue