Giter Site home page Giter Site logo

/cake/Cake: Permission denied about docker HOT 8 CLOSED

cake-build avatar cake-build commented on September 27, 2024
/cake/Cake: Permission denied

from docker.

Comments (8)

devlead avatar devlead commented on September 27, 2024

Interesting, cake --info and Cake --info works though. x would indicate execute bit is there.

image

What does your your docker file look like? Or how are you launching the container?

from docker.

gitfool avatar gitfool commented on September 27, 2024

From WSL, via docker run --rm -it cakebuild/cake:v0.32.1-2.1-sdk.

From Azure Pipelines, via Cake.Dungeon/azure-pipelines.yml#L10, in which I may be missing something as that build is my very first attempt to build with a Docker container on Azure Pipelines.

cake --info and Cake --info do work when I run them inside the container.

Note however that the executable bit is missing (for group and others) from /cake/Cake, as I showed above:

root@aab27beb84ed:/src# ls -al /cake/Cake
-rwxrw-rw- 1 root root 97416 Jan  4 20:42 /cake/Cake

from docker.

devlead avatar devlead commented on September 27, 2024

Bit is there for the executing user though
image
Container only has root user.

Other wise neither cake --info nor Cake -info should work.

With the yaml you link to I would assume the bash build step runs on the VM and not the container.

In general without a Docker file you can only run one command with docker run, a workaround would be something like docker run --rm -it cakebuild/cake:v0.32.1-2.1-sdk /bin/bash -c "cake --botstrap && cake"

A yaml step in Azure Pipelines could look something like

- task: Docker@1
  displayName: 'Run an image'
  inputs:
    containerregistrytype: 'Container Registry'

    command: 'Run an image'

    imageName: 'cakebuild/cake:v0.32.1-2.1-sdk'

    volumes: '$(Build.Repository.LocalPath):/repository'

    workingDirectory: /repository

    containerCommand: '/bin/bash -c "cake --botstrap && cake"'

    runInBackground: false

you could also have a Dockerfile in repo

Then step would look something like

- task: Docker@1
  displayName: 'Build image'

And a Dockerfile could look something like

FROM cakebuild/cake:v0.32.1-2.1-sdk AS builder

ADD .  /src

WORKDIR src

RUN  Cake --bootstrap && Cake

from docker.

gitfool avatar gitfool commented on September 27, 2024

I suspect it's to do with how Azure Pipelines runs the build steps. They add a user to the container, and according to Container jobs requirements, they "will docker exec a series of commands which expect to be run by a shell"; so you can have many build steps and each is run separately via docker exec.

from docker.

devlead avatar devlead commented on September 27, 2024

Ok I see, I've merged your PR, if I compiles CI should have a new container out in a couple minutes.

from docker.

devlead avatar devlead commented on September 27, 2024

A new v0.32.1-2.1-sdk is now on docker hub.

from docker.

gitfool avatar gitfool commented on September 27, 2024

Success! 😃

from docker.

devlead avatar devlead commented on September 27, 2024

Excellent 👍

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.