Docker Community Forums

Share and learn in the Docker community.

ERROR: yaml.parser.ParserError: while parsing a block collection

Hi Team,

I am trying to configure Wireguard-go using docker .
Pull the docker using below Command:

docker pull masipcat/wireguard-go

Then create yml file and add the below lines in it:
docker-compose.yaml

version: '3.3'
services:
  wireguard:
    image: masipcat/wireguard-go:latest
    cap_add:
     - NET_ADMIN
    sysctls:
     - net.ipv4.ip_forward=1
    volumes:
     - /dev/net/tun:/dev/net/tun
     # Folder with 'publickey', 'privatekey' and 'wg0.conf'
     - ./wireguard:/etc/wireguard
    environment:
     - WG_COLOR_MODE=always
     - LOG_LEVEL=info
    ports:
     - 51820:51820/udp
    # Uncomment the following line when 'AllowedIPs' is '0.0.0.0/0'
    # privileged: true
    restart: always

and run the below command for run the yml file:

docker-compose up -d

But i got some errobelow:

[root@ip-10-9-20-39 wireguard]# docker-compose up -d docker-compose.yaml
ERROR: yaml.parser.ParserError: while parsing a block collection
in “./docker-compose.yaml”, line 10, column 6
expected , but found ‘’
in “./docker-compose.yaml”, line 12, column 7

Please help me in this…