genuinetools / img

Standalone, daemon-less, unprivileged Dockerfile and OCI compatible container image builder.
https://blog.jessfraz.com/post/building-container-images-securely-on-kubernetes/
MIT License
3.9k stars 231 forks source link

Problem to build it on Mac #120

Closed zepouet closed 6 years ago

zepouet commented 6 years ago

Context

MacOS X Sierra 10.12.6 Docker Version

Client:
 Version:      18.03.1-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   9ee9f40
 Built:        Thu Apr 26 07:13:02 2018
 OS/Arch:      darwin/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.03.1-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.5
  Git commit:   9ee9f40
  Built:        Thu Apr 26 07:22:38 2018
  OS/Arch:      linux/amd64
  Experimental: true

Procedure

Problem comes when I want to build the binary on Mac with the command:

docker run --rm -it \
    --name img \
    --volume $(pwd):/home/user/src:ro \
    --workdir /home/user/src \
    --volume "${HOME}/.docker:/root/.docker:ro" \
    --cap-add SETGID \
    --cap-add SETUID \
    --security-opt apparmor=unconfined \
    --security-opt seccomp=unconfined \
    r.j3ss.co/img build -t user/myimage .

The result is:

nicolas@UnicornPark : ~/software/img >  ./build.sh
newuidmap: write to uid_map failed: Operation not permitted
nsenter: failed to use newuidmap: Invalid argument
nsenter: failed to sync with parent: SYNC_USERMAP_ACK: got 255: Invalid argument

Thanks a lot ! Best regards, Nicolas

jessfraz commented 6 years ago

This is not supported it says it in the readme.

jessfraz commented 6 years ago

Also what's the point... You already have docker :)

zepouet commented 6 years ago

Sorry Jessy I don't want to waste your time. You wrote : NOTE: These steps work only for Linux. Compile and run in a container (explained below) if you're on Windows or MacOS.

Thanks a lot for your all awesome work ! Have a nice day