canonical / rockcraft

Tool to create OCI Images using the language from Snapcraft and Charmcraft.
GNU General Public License v3.0
28 stars 37 forks source link

Using the `go` plugin clobbers `/bin` #21

Closed jnsgruk closed 7 months ago

jnsgruk commented 2 years ago

Using the go plugin recently I discovered that the /bin directory ended up clobbered in the resulting OCI image, containing just the binary I had built explicitly, and chroder

To repro:

name: traefik
version: "2.6.3"
base: ubuntu:20.04

parts:
  pebble:
    plugin: go
    source: https://github.com/canonical/pebble.git
    source-commit: 32ead042e94714625a138e61f7223c68cd6326f4

Then:

$ rockcraft pack
$ skopeo --insecure-policy copy oci-archive:traefik_2.6.3.rock docker-daemon:traefik:2.6.3
$ docker run --rm --entrypoint /usr/bin/ls -it traefik:2.6.3 -la /bin
total 11952
drwxr-xr-x 2 root root     4096 Apr  7 19:20 .
drwxr-xr-x 1 root root     4096 Apr  7 19:21 ..
-rwxr-xr-x 1 root root  2160377 Apr  7 19:20 chrorder
-rwxr-xr-x 1 root root 10065217 Apr  7 19:20 pebble
sergiusens commented 2 years ago

:facepalm:

This is probably because of the /usr merge:

➜  ~ ls -ld /bin
lrwxrwxrwx 1 root root 7 mar 13 16:30 /bin -> usr/bin
jnsgruk commented 2 years ago

That'll do it!

tigarmo commented 7 months ago

Closing this issue as since then we've improved Rockcraft's handling of the usrmerge