Skip to content

Commit 4357ed4

Browse files
committed
*: purge dockerinit from source code
dockerinit has been around for a very long time. It was originally used as a way for us to do configuration for LXC containers once the container had started. LXC is no longer supported, and /.dockerinit has been dead code for quite a while. This removes all code and references in code to dockerinit. Signed-off-by: Aleksa Sarai <[email protected]>
1 parent 141a301 commit 4357ed4

25 files changed

Lines changed: 13 additions & 259 deletions

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ RUN set -x \
9696
ENV PATH /osxcross/target/bin:$PATH
9797

9898
# install seccomp
99-
# this can be changed to the ubuntu package libseccomp-dev if dockerinit is removed,
100-
# we need libseccomp.a (which the package does not provide) for dockerinit
99+
# TODO: switch to libseccomp-dev since dockerinit is gone
101100
ENV SECCOMP_VERSION 2.2.3
102101
RUN set -x \
103102
&& export SECCOMP_PATH="$(mktemp -d)" \
@@ -114,7 +113,7 @@ RUN set -x \
114113

115114
# Install Go
116115
# IMPORTANT: If the version of Go is updated, the Windows to Linux CI machines
117-
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
116+
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
118117
# with a heads-up.
119118
ENV GO_VERSION 1.5.3
120119
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \

Dockerfile.armhf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint
111111
&& go install -v github.com/golang/lint/golint
112112

113113
# install seccomp
114-
# this can be changed to the ubuntu package libseccomp-dev if dockerinit is removed,
115-
# we need libseccomp.a (which the package does not provide) for dockerinit
114+
# TODO: switch to libseccomp-dev since dockerinit is gone
116115
ENV SECCOMP_VERSION 2.2.3
117116
RUN set -x \
118117
&& export SECCOMP_PATH="$(mktemp -d)" \

Dockerfile.gccgo

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ RUN cd /usr/local/lvm2 \
4242
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
4343

4444
# install seccomp
45-
# this can be changed to the ubuntu package libseccomp-dev if dockerinit is removed,
46-
# we need libseccomp.a (which the package does not provide) for dockerinit
45+
# TODO: switch to libseccomp-dev since dockerinit is gone
4746
ENV SECCOMP_VERSION v2.2.3
4847
RUN set -x \
4948
&& export SECCOMP_PATH=$(mktemp -d) \

api/client/info.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
7474
fmt.Fprintf(cli.out, " Goroutines: %d\n", info.NGoroutines)
7575
fmt.Fprintf(cli.out, " System Time: %s\n", info.SystemTime)
7676
fmt.Fprintf(cli.out, " EventsListeners: %d\n", info.NEventsListener)
77-
fmt.Fprintf(cli.out, " Init SHA1: %s\n", info.InitSha1)
78-
fmt.Fprintf(cli.out, " Init Path: %s\n", info.InitPath)
7977
fmt.Fprintf(cli.out, " Docker Root Dir: %s\n", info.DockerRootDir)
8078
}
8179

container/container_unix.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ func (container *Container) CreateDaemonEnvironment(linkedEnv []string) []string
6363
env := []string{
6464
"PATH=" + system.DefaultPathEnv,
6565
"HOSTNAME=" + fullHostname,
66-
// Note: we don't set HOME here because it'll get autoset intelligently
67-
// based on the value of USER inside dockerinit, but only if it isn't
68-
// set already (ie, that can be overridden by setting HOME via -e or ENV
69-
// in a Dockerfile).
7066
}
7167
if container.Config.Tty {
7268
env = append(env, "TERM=xterm")

contrib/builder/rpm/generate.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ for version in "${versions[@]}"; do
118118

119119
echo >> "$version/Dockerfile"
120120

121-
# fedora does not have a libseccomp.a for compiling static dockerinit
122-
# ONLY install libseccomp.a from source, this can be removed once dockerinit is removed
123-
# TODO remove this manual seccomp compilation once dockerinit is gone or no longer needs to be statically compiled
121+
# TODO remove this since dockerinit is finally gone
124122
case "$from" in
125123
fedora:*)
126124
awk '$1 == "ENV" && $2 == "SECCOMP_VERSION" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"

daemon/container_operations_unix.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ func (daemon *Daemon) populateCommand(c *container.Container, env []string) erro
254254
c.Command = &execdriver.Command{
255255
CommonCommand: execdriver.CommonCommand{
256256
ID: c.ID,
257-
InitPath: "/.dockerinit",
258257
MountLabel: c.GetMountLabel(),
259258
Network: en,
260259
ProcessConfig: processConfig,

daemon/container_operations_windows.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ func (daemon *Daemon) populateCommand(c *container.Container, env []string) erro
124124
CommonCommand: execdriver.CommonCommand{
125125
ID: c.ID,
126126
Rootfs: c.BaseFS,
127-
InitPath: "/.dockerinit",
128127
WorkingDir: c.Config.WorkingDir,
129128
Network: en,
130129
MountLabel: c.GetMountLabel(),

daemon/daemon_unix.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,7 @@ func initBridgeDriver(controller libnetwork.NetworkController, config *Config) e
688688
}
689689

690690
// setupInitLayer populates a directory with mountpoints suitable
691-
// for bind-mounting dockerinit into the container. The mountpoint is simply an
692-
// empty file at /.dockerinit
691+
// for bind-mounting things into the container.
693692
//
694693
// This extra layer is used by all containers as the top-most ro layer. It protects
695694
// the container from unwanted side-effects on the rw layer.
@@ -699,7 +698,6 @@ func setupInitLayer(initLayer string, rootUID, rootGID int) error {
699698
"/dev/shm": "dir",
700699
"/proc": "dir",
701700
"/sys": "dir",
702-
"/.dockerinit": "file",
703701
"/.dockerenv": "file",
704702
"/etc/resolv.conf": "file",
705703
"/etc/hosts": "file",

daemon/execdriver/driver.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ type CommonProcessConfig struct {
131131
type CommonCommand struct {
132132
ContainerPid int `json:"container_pid"` // the pid for the process inside a container
133133
ID string `json:"id"`
134-
InitPath string `json:"initpath"` // dockerinit
135134
MountLabel string `json:"mount_label"` // TODO Windows. More involved, but can be factored out
136135
Mounts []Mount `json:"mounts"`
137136
Network *Network `json:"network"`

0 commit comments

Comments
 (0)