Comments (10)
Fixed in 0.62.0.
from cli.
Looking at how project name is computed,
cli/src/spec-node/dockerCompose.ts
Line 635 in be1f203
in my config, I:
- don't use
COMPOSE_PROJECT_NAME
envvar - don't have
COMPOSE_PROJECT_NAME
in.env
- don't use toplevel
name:
in any of the compose files
Possibly b7fb42b somehow backfired in my case, but I don't see how :<
(excuse me for pinging @chrmarti)
from cli.
Could you run with --log-level trace
and append the output here?
from cli.
❯ npx devcontainer --workspace-folder=. up --log-level=trace
[1 ms] @devcontainers/cli 0.60.0. Node.js v22.1.0. darwin 23.4.0 arm64.
[1 ms] Start: Run: docker buildx version
[233 ms] Stop (232 ms): Run: docker buildx version
[233 ms] github.com/docker/buildx v0.14.0 Homebrew
[234 ms]
[234 ms] Start: Run: docker -v
[246 ms] Stop (12 ms): Run: docker -v
[246 ms] Start: Resolving Remote
[249 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/esgariot/Development/re/devcontainer --filter label=devcontainer.config_file=/Users/esgariot/Development/re/devcontainer/.devcontainer/devcontainer.json
[750 ms] Stop (501 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/esgariot/Development/re/devcontainer --filter label=devcontainer.config_file=/Users/esgariot/Development/re/devcontainer/.devcontainer/devcontainer.json
[752 ms] Start: Run: docker inspect --type container e73847f1b063
[1244 ms] Stop (492 ms): Run: docker inspect --type container e73847f1b063
[1251 ms] Start: Run: docker-compose version --short
[1425 ms] Stop (174 ms): Run: docker-compose version --short
[1425 ms] Docker Compose version: 2.27.0
[1425 ms] Start: Run: docker-compose -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.yaml -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.secrets.yaml -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.local.yaml --profile * config
[1914 ms] Stop (489 ms): Run: docker-compose -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.yaml -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.secrets.yaml -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.local.yaml --profile * config
[1914 ms] name: devcontainer
That's first few lines, name: devcontainer
is the project name (double checked by adding and writing something to name:
in compose).
I'm using remote docker context here, same thing happens on local context.
from cli.
On 0.56.0 it's fine, previous stack is found and compose reuses existing items.
0.56.0 logs
❯ npx devcontainer --workspace-folder=. up --log-level=trace
[0 ms] @devcontainers/cli 0.56.0. Node.js v22.1.0. darwin 23.4.0 arm64.
[0 ms] Start: Run: docker buildx version
[237 ms] Stop (237 ms): Run: docker buildx version
[237 ms] github.com/docker/buildx v0.14.0 Homebrew
[237 ms]
[237 ms] Start: Resolving Remote
[240 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/esgariot/Development/re/devcontainer --filter label=devcontainer.config_file=/Users/esgariot/Development/re/devcontainer/.devcontainer/devcontainer.json
[727 ms] Stop (487 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/esgariot/Development/re/devcontainer --filter label=devcontainer.config_file=/Users/esgariot/Development/re/devcontainer/.devcontainer/devcontainer.json
[728 ms] Start: Run: docker inspect --type container e73847f1b063
[1182 ms] Stop (454 ms): Run: docker inspect --type container e73847f1b063
[1190 ms] Start: Run: docker-compose version --short
[1359 ms] Stop (169 ms): Run: docker-compose version --short
[1359 ms] Docker Compose version: 2.27.0
[1360 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=devcontainer_devcontainer --filter label=com.docker.compose.service=dev
[1781 ms] Stop (421 ms): Run: docker ps -q -a --filter label=com.docker.compose.project=devcontainer_devcontainer --filter label=com.docker.compose.service=dev
[1781 ms] Start: Run: docker inspect --type container e73847f1b063
[2269 ms] Stop (488 ms): Run: docker inspect --type container e73847f1b063
[2273 ms] Start: Inspecting container
[2273 ms] Start: Run: docker inspect --type container e73847f1b06353163debdb1e0c686fcd5d5fc15778ee90de672e9065aaaf0e3a
[2736 ms] Stop (463 ms): Run: docker inspect --type container e73847f1b06353163debdb1e0c686fcd5d5fc15778ee90de672e9065aaaf0e3a
[2736 ms] Stop (463 ms): Inspecting container
[2738 ms] Start: Run in container: /bin/sh
[2742 ms] Start: Run in container: uname -m
[3694 ms] x86_64
[3695 ms]
[3695 ms] Stop (953 ms): Run in container: uname -m
[3695 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[3714 ms] PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
[3714 ms]
[3714 ms] Stop (19 ms): Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[3715 ms] Start: Run in container: (command -v getent >/dev/null 2>&1 && getent passwd 'user' || grep -E '^user|^[^:]*:[^:]*:user:' /etc/passwd || true)
[3731 ms] Stop (16 ms): Run in container: (command -v getent >/dev/null 2>&1 && getent passwd 'user' || grep -E '^user|^[^:]*:[^:]*:user:' /etc/passwd || true)
[3732 ms] Start: Run in container: test -f '/var/devcontainer/.patchEtcEnvironmentMarker'
[3748 ms]
[3748 ms]
[3748 ms] Stop (16 ms): Run in container: test -f '/var/devcontainer/.patchEtcEnvironmentMarker'
[3748 ms] Start: Run in container: test -f '/var/devcontainer/.patchEtcProfileMarker'
[3763 ms]
[3763 ms]
[3763 ms] Stop (15 ms): Run in container: test -f '/var/devcontainer/.patchEtcProfileMarker'
[3764 ms] userEnvProbe: loginInteractiveShell (default)
[3764 ms] LifecycleCommandExecutionMap: {
"onCreateCommand": [
{
"origin": "ghcr.io/esgariot/devcontainer-contrib/ghcup:latest",
"command": "/usr/local/share/devcontainer_feature/ghcup/install.sh"
},
{
"origin": "ghcr.io/esgariot/devcontainer-contrib/nvm:latest",
"command": "/usr/local/share/devcontainer_feature/nvm/install.sh"
},
{
"origin": "ghcr.io/esgariot/devcontainer-contrib/cabal:latest",
"command": "/usr/local/share/devcontainer_feature/cabal/install.sh"
},
{
"origin": "ghcr.io/esgariot/devcontainer-contrib/ghc:latest",
"command": "/usr/local/share/devcontainer_feature/ghc/install.sh"
},
{
"origin": "ghcr.io/esgariot/devcontainer-contrib/helix:latest",
"command": "/usr/local/share/devcontainer_feature/helix/install.sh"
},
{
"origin": "ghcr.io/esgariot/devcontainer-contrib/haskell-language-server:latest",
"command": "/usr/local/share/devcontainer_feature/haskell-language-server/install.sh"
}
],
"updateContentCommand": [],
"postCreateCommand": [],
"postStartCommand": [],
"postAttachCommand": [],
"initializeCommand": []
}
[3764 ms] userEnvProbe: not found in cache
[3765 ms] userEnvProbe shell: /usr/bin/zsh
[3765 ms] Start: Run in container: /usr/bin/zsh -lic echo -n 9bfe8241-833d-471a-8434-3873872926c4; cat /proc/self/environ; echo -n 9bfe8241-833d-471a-8434-3873872926c4
[3767 ms] Start: Run in container: mkdir -p '/home/user/.devcontainer' && CONTENT="$(cat '/home/user/.devcontainer/.onCreateCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2024-05-17T00:46:08.028791826Z}" != '2024-05-17T00:46:08.028791826Z' ] && echo '2024-05-17T00:46:08.028791826Z' > '/home/user/.devcontainer/.onCreateCommandMarker'
[3785 ms]
[3785 ms]
[3785 ms] Exit code 1
[3785 ms] Stop (18 ms): Run in container: mkdir -p '/home/user/.devcontainer' && CONTENT="$(cat '/home/user/.devcontainer/.onCreateCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2024-05-17T00:46:08.028791826Z}" != '2024-05-17T00:46:08.028791826Z' ] && echo '2024-05-17T00:46:08.028791826Z' > '/home/user/.devcontainer/.onCreateCommandMarker'
[3786 ms] Start: Run in container: mkdir -p '/home/user/.devcontainer' && CONTENT="$(cat '/home/user/.devcontainer/.updateContentCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2024-05-17T00:46:08.028791826Z}" != '2024-05-17T00:46:08.028791826Z' ] && echo '2024-05-17T00:46:08.028791826Z' > '/home/user/.devcontainer/.updateContentCommandMarker'
[3804 ms]
[3804 ms]
[3804 ms] Exit code 1
[3804 ms] Stop (18 ms): Run in container: mkdir -p '/home/user/.devcontainer' && CONTENT="$(cat '/home/user/.devcontainer/.updateContentCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2024-05-17T00:46:08.028791826Z}" != '2024-05-17T00:46:08.028791826Z' ] && echo '2024-05-17T00:46:08.028791826Z' > '/home/user/.devcontainer/.updateContentCommandMarker'
[3804 ms] Start: Run in container: mkdir -p '/home/user/.devcontainer' && CONTENT="$(cat '/home/user/.devcontainer/.postCreateCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2024-05-17T00:46:08.028791826Z}" != '2024-05-17T00:46:08.028791826Z' ] && echo '2024-05-17T00:46:08.028791826Z' > '/home/user/.devcontainer/.postCreateCommandMarker'
[3820 ms]
[3820 ms]
[3820 ms] Exit code 1
[3820 ms] Stop (16 ms): Run in container: mkdir -p '/home/user/.devcontainer' && CONTENT="$(cat '/home/user/.devcontainer/.postCreateCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2024-05-17T00:46:08.028791826Z}" != '2024-05-17T00:46:08.028791826Z' ] && echo '2024-05-17T00:46:08.028791826Z' > '/home/user/.devcontainer/.postCreateCommandMarker'
[3820 ms] Start: Run in container: mkdir -p '/home/user/.devcontainer' && CONTENT="$(cat '/home/user/.devcontainer/.postStartCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2024-05-17T00:46:08.259840071Z}" != '2024-05-17T00:46:08.259840071Z' ] && echo '2024-05-17T00:46:08.259840071Z' > '/home/user/.devcontainer/.postStartCommandMarker'
[3835 ms]
[3835 ms]
[3835 ms] Exit code 1
[3835 ms] Stop (15 ms): Run in container: mkdir -p '/home/user/.devcontainer' && CONTENT="$(cat '/home/user/.devcontainer/.postStartCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2024-05-17T00:46:08.259840071Z}" != '2024-05-17T00:46:08.259840071Z' ] && echo '2024-05-17T00:46:08.259840071Z' > '/home/user/.devcontainer/.postStartCommandMarker'
[3835 ms] Stop (3598 ms): Resolving Remote
{"outcome":"success","containerId":"e73847f1b06353163debdb1e0c686fcd5d5fc15778ee90de672e9065aaaf0e3a","composeProjectName":"devcontainer_devcontainer","remoteUser":"user","remoteWorkspaceFolder":"/workspace"}
from cli.
One could use name: devcontainer_devcontainer
in compose file as a workaround.
from cli.
❯ npx devcontainer --workspace-folder=. up --log-level=trace [1 ms] @devcontainers/cli 0.60.0. Node.js v22.1.0. darwin 23.4.0 arm64. [1 ms] Start: Run: docker buildx version [233 ms] Stop (232 ms): Run: docker buildx version [233 ms] github.com/docker/buildx v0.14.0 Homebrew [234 ms] [234 ms] Start: Run: docker -v [246 ms] Stop (12 ms): Run: docker -v [246 ms] Start: Resolving Remote [249 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/esgariot/Development/re/devcontainer --filter label=devcontainer.config_file=/Users/esgariot/Development/re/devcontainer/.devcontainer/devcontainer.json [750 ms] Stop (501 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/esgariot/Development/re/devcontainer --filter label=devcontainer.config_file=/Users/esgariot/Development/re/devcontainer/.devcontainer/devcontainer.json [752 ms] Start: Run: docker inspect --type container e73847f1b063 [1244 ms] Stop (492 ms): Run: docker inspect --type container e73847f1b063 [1251 ms] Start: Run: docker-compose version --short [1425 ms] Stop (174 ms): Run: docker-compose version --short [1425 ms] Docker Compose version: 2.27.0 [1425 ms] Start: Run: docker-compose -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.yaml -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.secrets.yaml -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.local.yaml --profile * config [1914 ms] Stop (489 ms): Run: docker-compose -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.yaml -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.secrets.yaml -f /Users/esgariot/Development/re/devcontainer/.devcontainer/docker-compose.local.yaml --profile * config [1914 ms] name: devcontainer
That's first few lines,
name: devcontainer
is the project name (double checked by adding and writing something toname:
in compose).I'm using remote docker context here, same thing happens on local context.
Not sure I follow, do you have name: devcontainer
in any of your docker-compose.yml files? The change in behavior would be disruptive if you have name:
set to something other than a useful project name.
from cli.
Sorry for the confusion. No, I don't have the name:
in my compose files, and I've verified that by writing arbitrary name: foo
and seeing how the project name is computed.
If I have a docker compose file without name:
key, then I see name: devcontainer
in npx devcontainer up
output, but only on 0.60.0 installed via npm install
If I have a docker compose file with name: foo
then I see name:foo
in npx devcontainer up
's output, as expected. That was just to doublecheck.
from cli.
Got it, docker compose config
shows that since it's the inferred name and the CLI wrongly assumes it is part of the user's config file.
from cli.
Introduced with microsoft/vscode-remote-release#512.
from cli.
Related Issues (20)
- Dockerfile for runing devcontainer/cli
- `docker-compose.devcontainer.containerFeatures.TIMESTAMP.yml` race conditions
- Start devcontainer (up) from already built image HOT 2
- Dependency confusion attack from looking for manifest in docker.io first HOT 2
- Can't publish a feature with private AWS ECR repository as a registry HOT 2
- `overrideCommand` option does not correctly overwrite entrypoint
- Dynamic Environment Variable HOT 1
- Evaluating Local Environment Variables With Prebuilds HOT 4
- [![Test Build Processes](https://github.com/wexkalebur/wordpress-develop/actions/workflows/test-build-processes.yml/badge.svg?branch=trunk)](https://github.com/wexkalebur/wordpress-develop/actions/workflows/test-build-processes.yml)
- Support updating lifecycle scripts on existing containers HOT 2
- Unable to build multi-platform images HOT 5
- Incorrect field used as mapping key for deserialization of 'mounts' in devcontainer.json HOT 1
- Image and feature digest pinning syntax inconsistency HOT 2
- Should `devcontainers/cli` uses `docker compose` always instead `docker-compose`? HOT 3
- Feature request: `@devcontainers/cli` as a docker CLI plugin
- Ability to provide version to publish HOT 6
- Speed up installing dotfiles by loading only latest commit
- obtuse and confusing error with local feature under WSL HOT 4
- Feature Request: Allow devcontainer up to Start Only the Specified Service and Its Dependencies HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.