← Back to issue list

`--workdir` is ignored

View original Github issue

Metadata

Project
snapcraft-rocks
Number
#40
Type
issue
State
open
Author
VladRassokhin
Labels
—
Created
Updated
Closed
—

Current evaluation

Reporter: --workdir ignored by snapcraft-rocks containers; only /project works. Full docker repro given. Doc gap conceded by reporter, but why custom dirs are rejected (entrypoint/pwdb) is still unconfirmed. No maintainer response.

Suggested action: needs triage

Reason: The issue carries no labels, no assignee, and no maintainer response; the only comment is the reporter's own, so it has never been assessed by a maintainer, which is the definition of needs_triage. Impact is modest rather than high because a documented workaround exists: upstream snapcraft/docker/README.md documents `-v \`pwd\`:/project ghcr.io/canonical/snapcraft:8_core24`, and the reporter himself confirmed the doc half is answered, leaving only the open question of why --workdir is rejected. Confidence is held down because the core22-8 branch holding rockcraft.yaml and the wrapper script is not present in the available mirror, so I could not locate the entrypoint that hardcodes /project, confirm whether a fix has since landed, or distinguish a rockcraft-side regression from expected pebble behaviour.

Evaluated by: mr-cal-bot

Impact: 30 Quick Win: 11 Complexity: 35 Confidence: 48 Actionability: 55

Issue body

Not sure whether it's a bug of run-snapcraft.sh or pebble. In the old official docker container it was possible to place snapcraft.yaml into an arbitrary directory (e.g. mount it as `...:/build/snapcraft.yaml:ro`) and use `--workdir=/build`. Now it doesn't work and gives following error: ``` 2024-04-29T09:59:11.631Z [snapcraft] Could not find snap/snapcraft.yaml. Are you sure you are in the right directory? 2024-04-29T09:59:11.631Z [snapcraft] Recommended resolution: To start a new project, use `snapcraft init` ``` Whole docker args if you're interested (paths removed and newlines added for readability): ```text docker run --rm --volume=/work/out/idea-ce/dist.snap.amd64/snapcraft.yaml:/build/snapcraft.yaml:ro --volume=/work/out/idea-ce/dist.snap.amd64/intellij-idea-community.desktop:/build/snap/gui/intellij-idea-community.desktop:ro --volume=/work/out/idea-ce/dist.snap.amd64/intellij-idea-community.png:/build/prime/meta/gui/icon.png:ro --volume=/work/out/idea-ce/dist.snap.amd64/result:/build/result --volume=/work/out/idea-ce/dist.all:/build/dist.all:ro --volume=/work/out/idea-ce/temp/linux.dist.snap.product-info.json.amd64:/build/dist.product-json:ro --volume=/work/out/idea-ce/dist.unix.x64:/build/dist.unix:ro --volume=/work/community/build/download/jbr_jcef-21.0.3b442.1-linux-x64:/build/jre:ro --workdir=/build ghcr.io/canonical/snapcraft:8_core22@sha256:ea7434407f1ccede1feee183b982b23e1914a36267701063c392fb299a04dd89 snap --build-for=amd64 -o result/intellij-idea-community_2024.2-EAP_amd64.snap ``` Turns out one must inspect sources (https://github.com/canonical/snapcraft-rocks/blob/core22-8/rockcraft.yaml) and use `/project`. Is it documented anywhere?

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 30
Quick Win: 11
Complexity: 35
Confidence: 48
Actionability: 55
needs triage Reporter: --workdir ignored by snapcraft-rocks containers; only /project works. Full docker repro given. Doc gap conceded by reporter, but why custom dirs are rejected (entrypoint/pwdb) is still unconfirmed. No maintainer response.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 14
Complexity: 20
Confidence: 70
Actionability: 60
needs triage User reports --workdir flag is ignored in snapcraft docker container; discovered workaround is using /project instead. Issue lacks labels and maintainer response after 873 days.
qwen/qwen3.8-27b
Impact: 20
Quick Win: 14
Staleness: 85
Complexity: 30
Confidence: 60
Support Request: 65
needs triage Reporter found snapcraft rock ignores --workdir and requires project mounted at /project; self-resolved that /project is documented in README but not the announcement, leaving an open question on why a custom workdir cannot be used. No maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 30
Confidence: 80
Support Request: 20
close stale --workdir flag ignored in snapcraft Docker container; author found workaround using /project but original behavior remains unresolved. No maintainer response or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 92
Complexity: 20
Confidence: 75
Support Request: 30
needs triage Report that --workdir flag is ignored in snapcraft Docker image, forcing usage of /project instead. Unlabelled, inactive for over two years, author noted workaround but question remains open.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#60 Set `WORKDIR /workdir` on Docker level snapcraft-rocks open Feature request to set Docker WORKDIR to /workdir as a base-image convention for snapcraft rocks. Discussed by maintainers, who are skeptical (GH search shows /app far more common); no agreement or implementation.
73%