Skip to content

Commit

Permalink
host-ctr: add '/etc/bottlerocket-release' to host containers
Browse files Browse the repository at this point in the history
This grants host containers context to the underlying OS by mounting
Bottlerocket's '/etc/os-release' as '/etc/bottlerocket-release'.
  • Loading branch information
jpculp committed Jan 3, 2022
1 parent 78331de commit 47f22aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sources/host-ctr/cmd/host-ctr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,12 @@ func withDefaultMounts(containerID string, persistentDir string) oci.SpecOpts {
Source: "cgroup",
Options: []string{"ro", "nosuid", "noexec", "nodev"},
},
// Bottlerocket release information for the container
{
Options: []string{"bind", "ro"},
Destination: fmt.Sprintf("/etc/bottlerocket-release"),
Source: fmt.Sprintf("/etc/os-release"),
},
}

// The `current` dir was added for easier referencing in Dockerfiles and scripts.
Expand Down

0 comments on commit 47f22aa

Please sign in to comment.