containers / build

another build tool for container images (archived, see https://github.com/rkt/rkt/issues/4024)
Apache License 2.0
342 stars 80 forks source link

Getting build failures running on Ubuntu and Redhat #279

Closed srizzling closed 6 years ago

srizzling commented 7 years ago

acbuild version: acbuild version v0.4.0-27-g41d5234-dirty appc version 0.8.5

OS: Ubuntu Xenial and centos7.2

I have tried using the latest acbuild. The above version includes some debugging I have added to dig down to what the issue is.

I followed the documentation provided so I

I used the following build script via sudo: examples/nginx/build-nginx.sh

And I got the following error:

ubuntu@ubuntu-xenial:/vagrant/examples/nginx$ sudo ./build-nginx.sh
Beginning build with an empty ACI
Setting name of ACI to example.com/nginx
Adding dependency "quay.io/coreos/alpine-sh"
Running: [apk update]
Downloading quay.io/coreos/alpine-sh: [========================] 2.65 MB/2.65 MB
exit status 1
run: extracttar error: exit status 1, output: uid: &{%!s(uint32=0) %!s(uint32=0)}editor error has occured here, /rootfs/bin/bbsuid, %!s(int=0), %!s(int=0), %!s(uint8=48), {%!s(*tar.Header=&{rootfs/bin/bbsuid 2121 0 0 9944 {63565487184 0 0xc81a60} 48    0 0 {0 0 <nil>} {0 0 <nil>} map[]})}, lchown /rootfs/bin/bbsuid: operation not permittederror extracting tar

I also tried disabling AppArmor and ran again but this was to no avail, I'm not really sure what is going on, are you able to provide some guidance as to this failure?

cgonyeo commented 7 years ago

I'm honestly not sure what's going on here. It looks like the error is coming from deep within rkt's untaring logic (acbuild uses a part of rkt as a library to untar things).

timperrett commented 7 years ago

@dgonyeo I'm also seeing this one (just picked up acbuild today). Some specifics:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.10
Release:    16.10
Codename:   yakkety

acbuild:

$ acbuild version
acbuild version v0.4.0
appc version 0.8.5

rkt info:

$ rkt version
rkt Version: 1.25.0
appc Version: 0.8.10
Go Version: go1.7.4
Go OS/Arch: linux/amd64
Features: -TPM +SDJOURNAL

Here's the build script im running:

acbuild begin
acbuild set-name testing.com/aloha
acbuild dependency add quay.io/coreos/alpine-sh
sudo acbuild run -- echo 'foo'
acbuild end

This is the most minimal case that fails for me. I've checked system specifics, and its not like i'm running out of disk or inodes. This is a Ubuntu VM run on OSX via Parallels desktop.

$ df -i
Filesystem      Inodes  IUsed   IFree IUse% Mounted on
udev            249994    496  249498    1% /dev
tmpfs           255427    832  254595    1% /run
/dev/sda1      4063232 393221 3670011   10% /
tmpfs           255427      8  255419    1% /dev/shm
tmpfs           255427      6  255421    1% /run/lock
tmpfs           255427     18  255409    1% /sys/fs/cgroup

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            977M     0  977M   0% /dev
tmpfs           200M  9.2M  191M   5% /run
/dev/sda1        61G   11G   48G  19% /
tmpfs           998M  140K  998M   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           998M     0  998M   0% /sys/fs/cgroup
timperrett commented 7 years ago

@dgonyeo for what its worth, i tried both the latest acbuild and 0.3.1, but both have this issue.

timperrett commented 7 years ago

@dgonyeo so it seems like there are a couple of issues:

  1. i was mounting a volume inside the VM and for some reason acbuild does not like that (wouldn't work as a user or as root user).

  2. Once using the plain FS of the VM, i could build using root, but not as a system user. It's a workaround for now, but why would all the acbuild commands need to run as root? Is it something to do with the run statement requiring elevated privs? either way, building as root is really not ideal. Is there some other way to work around this?

Thanks

cgonyeo commented 7 years ago

Building as root is necessary for the run command, yes. There's no real way around it, due to the overlayfs mount, chroot, and namespaces it needs to set up. It's the same story as in docker, you're just asking a daemon running as root to do it for you instead of doing it yourself.

If the run command isn't used, root shouldn't be necessary, but file ownership in the produced image will be weird.

srizzling commented 6 years ago

Closing issue, as I have moved away from using acbuild in favour of buildrah