Skip to content

[WIP] Separate static binary for chrootarchive#43186

Closed
corhere wants to merge 1 commit intomoby:masterfrom
corhere:42402-static-chrootarchive
Closed

[WIP] Separate static binary for chrootarchive#43186
corhere wants to merge 1 commit intomoby:masterfrom
corhere:42402-static-chrootarchive

Conversation

@corhere
Copy link
Contributor

@corhere corhere commented Jan 25, 2022

An implementation of #42402 (comment) to solicit feedback before polishing it up, integrating into the build scripts and fixing tests.

Safety is assured, as much as possible, by ensuring that the binary which chroots into container filesystems is statically linked, with no libc to introduce vulnerabilities as side-effects.

  • libc-less link is asserted at compile-time by ensuring that go build will fail if cgo is enabled
  • static linking is asserted at runtime by the binary parsing its own executable image to verify that it does not contain any dynamic linking information

To try it out,

CGO_ENABLED=0 go build ./cmd/docker-chrootarchive

and copy the binary into a directory on your $PATH.

@corhere
Copy link
Contributor Author

corhere commented Feb 10, 2022

@tonistiigi @thaJeztah @kolyshkin @cpuguy83 what do you think of this solution? A new binary would be required on *nix platforms, which will impact everyone packaging Docker; is this an acceptable tradeoff?

@corhere
Copy link
Contributor Author

corhere commented Oct 21, 2022

@corhere corhere closed this Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant