My system info:
OS: Fedora Linux 39 (Workstation Edition)
docker: 25.0.0
docker-compose: 1.29.2
Here is my docker compose override file.
version: "3"
services:
server:
command: sh -c "./manage.py migrate && ./manage.py runserver 0.0.0.0:9000"
env_file: .env
ports:
- "8000:9000"
volumes:
- ./organicauras:/code
After runnig docker compose up I am getting this issue:
validating /home/rahul/workstation/organicauras/docker-compose.override.yml: (root) must be a mapping
rimelek
(Ćkos TakĆ”cs)
January 21, 2024, 12:51pm
2
That file probably contains a non-printable character. Otherwise it would not complain about the root of the yaml not being a mapping, Try to create a new file and type the code again to see if thatās the case.
You should also use Docker Compose v2, not v1 which is not supportedanymore
My system info:
OS: Ubuntu 23.10
docker: 25.0.0
docker-compose: 2.24.1
My docker compose file (generated by vscode devcontainer)
$HOME/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1705656232830.yml
:
version: '3.2'
services:
dev:
build:
dockerfile: /tmp/devcontainercli-eryk/container-features/0.54.1-1705656232828/Dockerfile-with-features
args:
- BUILDKIT_INLINE_CACHE=1
- _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label
Checked non-printable characters, only spaces and '\nās.
Was working until docker upgrade:
Commandline: aptdaemon role='role-commit-packages' sender=':1.720'
Upgrade: docker-compose-plugin:amd64 (2.21.0-1~ubuntu.22.04~jammy, 2.24.1-1~ubuntu.22.04~jammy), docker-ce-cli:amd64 (5:24.0.7-1~ubuntu.22.04~jammy, 5:25.0.0-1~ubuntu.22.04~jammy), docker-buildx-plugin:amd64 (0.11.2-1~ubuntu.22.04~jammy, 0.12.1-1~ubuntu.22.04~jammy), docker-ce:amd64 (5:24.0.7-1~ubuntu.22.04~jammy, 5:25.0.0-1~ubuntu.22.04~jammy), docker-ce-rootless-extras:amd64 (5:24.0.7-1~ubuntu.22.04~jammy, 5:25.0.0-1~ubuntu.22.04~jammy)
End-Date: 2024-01-20 22:10:29
EDIT
reverting the upgrade makes it work again:
sudo apt-get install docker-compose-plugin:amd64=2.21.0-1~ubuntu.22.04~jammy docker-ce-cli:amd64=5:24.0.7-1~ubuntu.22.04~jammy docker-buildx-plugin:amd64=0.11.2-1~ubuntu.22.04~jammy docker-ce:amd64=5:24.0.7-1~ubuntu.22.04~jammy docker-ce-rootless-extras:amd64=5:24.0.7-1~ubuntu.22.04~jammy
deimi86
(Deimi86)
January 22, 2024, 1:11pm
4
It seems that a fix is on the way
opened 08:19AM - 22 Jan 24 UTC
closed 10:55AM - 22 Jan 24 UTC
kind/bug
### Description
hi,
i use vscode with remote containers. since 2.4.1 i get tā¦ he following error (`(root) must be a mapping`), when vscode tries to build my remote container via `docker-compose`:
~~~sh
āÆ docker-compose --project-name vscode -f /home/usc/.config/vscode/development.yml -f /home/usc/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1705311452770.yml -f /home/usc/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.containerFeatures-1705311453367.yml up -d --no-recreate
validating /home/usc/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1705311452770.yml: (root) must be a mapping
~~~
the problematic file looks like this
~~~yaml
version: '3'
services:
go-development:
build:
dockerfile: /tmp/devcontainercli-usc/container-features/0.54.1-1705311452768/Dockerfile-with-features
args:
- BUILDKIT_INLINE_CACHE=1
- _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label
~~~
when i change the args to a mapping like this
~~~yaml
args:
BUILDKIT_INLINE_CACHE: 1
_DEV_CONTAINERS_BASE_IMAGE: dev_container_auto_added_stage_label
~~~
it works. but the file is generated by vscocde and so i cannot use this workaround.
### Steps To Reproduce
Use docker-compose to build an image with an overlay file where build-args are overridden as a list and not as a map.
### Compose Version
```Text
āÆ docker-compose --version
Docker Compose version 2.24.1
```
### Docker Environment
```Text
Client:
Version: 24.0.7
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: 0.12.1
Path: /usr/lib/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: 2.24.1
Path: /usr/lib/docker/cli-plugins/docker-compose
Server:
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 1950
Server Version: 24.0.7
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: true
Native Overlay Diff: false
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 71909c1814c544ac47ab91d2e8b84718e517bb99.m
runc version:
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.7.0-arch3-1
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 62.5GiB
Name: usc-tux15
ID: TY7Y:MYLF:VXR5:O2NM:3NH4:E5XH:BMJD:SWDE:C7HU:SYUO:U33R:7LZM
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
```
### Anything else?
_No response_
A temporary solution is to downgrade your docker-compose-plugin package below 2.24.1
1 Like
rimelek
(Ćkos TakĆ”cs)
January 22, 2024, 6:50pm
5
Than you for sharing the github link! I wouldnāt have noticed it probably, since I always pass build arguments and environment variables as a mapping, not a list. And Iām still using v2.23, because I wanted to wait with the upgrade.
I upgrade my docker-compose now the version is v2.24.1. Also I create another file and type the codes there but its return the same error.
(sorry for late reply I was sick )
You downgrade your docker compose and its working right???
Yep, in my case the downgrade was (ubuntu): sudo apt-get install docker-compose-plugin:amd64=2.21.0-1~ubuntu.22.04~jammy docker-ce-cli:amd64=5:24.0.7-1~ubuntu.22.04~jammy docker-buildx-plugin:amd64=0.11.2-1~ubuntu.22.04~jammy docker-ce:amd64=5:24.0.7-1~ubuntu.22.04~jammy docker-ce-rootless-extras:amd64=5:24.0.7-1~ubuntu.22.04~jammy
Thank you everyone, After update my version it is working fine