devcontainers / devcontainers/cli
devcontainer build with --push true failed when use image property
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 457
- Avg merge
- 13h 17m
- Merged PRs (30d)
- 6
Description
**devcontainer version**: `0.27.1`
#### devcontainer.json with image property
```json
{
"name": "kaitian-devcontainer",
"image": "mcr.microsoft.com/devcontainers/javascript-node:14",
"features": {
"ghcr.io/stickmy/merchant-legacy-dev-features/kaitian:1.0.1": {}
}
}
```
#### command
```bash
devcontainer build --workspace-folder . --image-name ghcr.io/stickmy/kaitian-devcontainer:1.0.0 --push true
```
The error message:
```
=> ERROR pushing vsc-kaitian-devcontainer-27da8ffe3eebb26605196a518a9f1f
ERROR: denied: requested access to the resource is denied
{"outcome":"error","message":"Command failed: docker buildx build --push --build-context dev_containers_feature_content_source=/var/folders/3n/0hqblg7d3mq2q0nlzkj31pgr0000gp/T/devcontainercli/container-features/0.27.1-1673115040210 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/javascript-node:14 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-kaitian-devcontainer-27da8ffe3eebb26605196a518a9f1f22-features -f /var/folders/3n/0hqblg7d3mq2q0nlzkj31pgr0000gp/T/devcontainercli/container-features/0.27.1-1673115040210/Dockerfile.extended /var/folders/3n/0hqblg7d3mq2q0nlzkj31pgr0000gp/T/devcontainercli/empty-folder","description":"An error occurred building the container."}
```
But the build works with `build` property
```json
{
"name": "kaitian-devcontainer",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "14"
}
},
"features": {
"ghcr.io/stickmy/merchant-legacy-dev-features/kaitian:1.0.1": {}
}
}
```
**Dockerfile**
```
ARG VARIANT="14"
FROM mcr.microsoft.com/devcontainers/javascript-node:${VARIANT}
```
Contributor guide
Assessment
This issue has not been assessed yet.