E: Failed to unshare: Operation not permitted

I have a program that runs a script to build. When the script runs cdebootstrap, it works for a while and then says:

E: Failed to unshare: Operation not permitted

Here is my config.yml:

version: 2
      - image: debian:stretch

      - checkout

      - run: apt update
      - run: apt install -y sudo wget
      - run:
          name: Change script permissions
          command: sudo chmod u+x create-targz-x64.sh

      - run:
          name: Build
          command: sudo ./create-targz-x64.sh

Sorry about that, just fixed it.

1 Like

No worries. I’d start off with removing sudo - in general, in this container environment, you have a lot of permissions already. I don’t think you’re actually the container root, but you can do a lot of things. Try removing it and seeing whether that helps.

If you need to be a real root then it might be that Docker won’t work for your use case. In that case, switch to the Machine executor - that is a real VM rather than a containerised environment.

I’ve removed sudo and I still get the same error

1 Like