Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task still requires privileged access (run image: run-jammy-full) #42

Open
novellat opened this issue Aug 7, 2024 · 0 comments
Open

Comments

@novellat
Copy link

novellat commented Aug 7, 2024

It is failing in the create step.

2024/08/07 13:37:33 warning: unsuccessful cred copy: ".docker" from "/tekton/creds" to "/": unable to create destination directory: mkdir /.docker: permission denied
2024/08/07 13:37:33 warning: unsuccessful cred copy: ".gitconfig" from "/tekton/creds" to "/": unable to open destination: open /.gitconfig: permission denied
2024/08/07 13:37:33 warning: unsuccessful cred copy: ".git-credentials" from "/tekton/creds" to "/": unable to open destination: open /.git-credentials: permission denied
ERROR: failed to exec as user 1001:1001: operation not permitted

Seems that it needs the root folder for whatever reason.
I've even tried to update the platform to 0.14, didn't help.

This is how it's called.

env:
  - name: CNB_PLATFORM_API
    value: '0.9'
  - name: DOCKER_CONFIG
name: create
resources: {}
args:
  - '-app=/workspace/source/.'
  - '-cache-dir=/workspace/cache'
  - '-cache-image=/workspace/cache'
  - '-uid=1001'
  - '-gid=1001'
  - '-layers=/layers'
  - '-platform=/platform'
  - '-report=/layers/report.toml'
  - '-process-type=web'
  - '-skip-restore=false'
  - '-previous-image=OUR_ARTIFACTORY/backstage-docker-local/bcp-diagnostics-bp-tkn-test:0.1.0.alpha'
  - '-run-image=OUR_ARTIFACTORY/dockerio/paketobuildpacks/run-jammy-full' # <<---MIND THIS, we updated it
  - OUR_ARTIFACTORY/backstage-docker-local/bcp-diagnostics-bp-tkn-test:0.1.0.alpha
command:
  - /cnb/lifecycle/creator
image: OUR_ARTIFACTORY/dockerio/paketobuildpacks/builder-jammy-base
imagePullPolicy: Always
securityContext:
  runAsGroup: 1000
  runAsUser: 1000
volumeMounts:
  - mountPath: /layers
    name: layers-dir
  - mountPath: /platform
    name: empty-dir

Why is it touching the root folder?
The quick fix is obvious, change the security context, but ideally we wounld't do that....

@novellat novellat changed the title Task still requires privileged access Task still requires privileged access (run image: run-jammy-full) Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant