Skip to content

Commit 2790ac6

Browse files
committed
Add expected 3rd party binaries commit ids to info
Signed-off-by: Kenfe-Mickael Laventure <[email protected]>
1 parent 5125484 commit 2790ac6

21 files changed

Lines changed: 157 additions & 13 deletions

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
236236

237237
# Install tomlv, vndr, runc, containerd, tini, docker-proxy
238238
# Please edit hack/dockerfile/install-binaries.sh to update them.
239+
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
239240
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
240241
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy
241242

Dockerfile.aarch64

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
164164

165165
# Install tomlv, vndr, runc, containerd, tini, docker-proxy
166166
# Please edit hack/dockerfile/install-binaries.sh to update them.
167+
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
167168
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
168169
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy
169170

Dockerfile.armhf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
168168

169169
# Install tomlv, vndr, runc, containerd, tini, docker-proxy
170170
# Please edit hack/dockerfile/install-binaries.sh to update them.
171+
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
171172
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
172173
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy
173174

Dockerfile.ppc64le

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
187187

188188
# Install tomlv, vndr, runc, containerd, tini, docker-proxy
189189
# Please edit hack/dockerfile/install-binaries.sh to update them.
190+
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
190191
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
191192
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy
192193

Dockerfile.s390x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
179179

180180
# Install tomlv, vndr, runc, containerd, tini, docker-proxy
181181
# Please edit hack/dockerfile/install-binaries.sh to update them.
182+
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
182183
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
183184
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy
184185

Dockerfile.simple

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ ENV CGO_LDFLAGS -L/lib
6060

6161
# Install runc, containerd, tini and docker-proxy
6262
# Please edit hack/dockerfile/install-binaries.sh to update them.
63+
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
6364
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
6465
RUN /tmp/install-binaries.sh runc containerd tini proxy
6566

api/types/types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ type Version struct {
150150
BuildTime string `json:",omitempty"`
151151
}
152152

153+
// Commit records a external tool actual commit id version along the
154+
// one expect by dockerd as set at build time
155+
type Commit struct {
156+
ID string
157+
Expected string
158+
}
159+
153160
// InfoBase contains the base response of Remote API:
154161
// GET "/info"
155162
type InfoBase struct {
@@ -207,6 +214,10 @@ type InfoBase struct {
207214
// running containers are detected
208215
LiveRestoreEnabled bool
209216
Isolation container.Isolation
217+
InitBinary string
218+
ContainerdCommit Commit
219+
RuncCommit Commit
220+
InitCommit Commit
210221
}
211222

212223
// SecurityOpt holds key/value pair about a security option

cli/command/system/info.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ func prettyPrintInfo(dockerCli *command.DockerCli, info types.Info) error {
143143
}
144144

145145
if info.OSType == "linux" {
146+
fmt.Fprintf(dockerCli.Out(), "Init Binary: %v\n", info.InitBinary)
147+
148+
for _, ci := range []struct {
149+
Name string
150+
Commit types.Commit
151+
}{
152+
{"containerd", info.ContainerdCommit},
153+
{"runc", info.RuncCommit},
154+
{"init", info.InitCommit},
155+
} {
156+
fmt.Fprintf(dockerCli.Out(), "%s version: %s", ci.Name, ci.Commit.ID)
157+
if ci.Commit.ID != ci.Commit.Expected {
158+
fmt.Fprintf(dockerCli.Out(), " (expected: %s)", ci.Commit.Expected)
159+
}
160+
fmt.Fprintf(dockerCli.Out(), "\n")
161+
}
146162
if len(info.SecurityOptions) != 0 {
147163
fmt.Fprintf(dockerCli.Out(), "Security Options:\n")
148164
for _, o := range info.SecurityOptions {

daemon/config_common_unix.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,13 @@ func (config *Config) GetAllRuntimes() map[string]types.Runtime {
7878
func (config *Config) GetExecRoot() string {
7979
return config.ExecRoot
8080
}
81+
82+
// GetInitPath returns the configure docker-init path
83+
func (config *Config) GetInitPath() string {
84+
config.reloadLock.Lock()
85+
defer config.reloadLock.Unlock()
86+
if config.InitPath != "" {
87+
return config.InitPath
88+
}
89+
return DefaultInitBinary
90+
}

daemon/config_windows.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ func (config *Config) GetRuntime(name string) *types.Runtime {
4646
return nil
4747
}
4848

49+
// GetInitPath returns the configure docker-init path
50+
func (config *Config) GetInitPath() string {
51+
return ""
52+
}
53+
4954
// GetDefaultRuntimeName returns the current default runtime
5055
func (config *Config) GetDefaultRuntimeName() string {
5156
return stockRuntimeName

0 commit comments

Comments
 (0)