unable to build docker-compose yml file

+1 vote
I am trying to create container with ssh service and I have successfully created a dockerfile with following code:

FROM centos
RUN yum -y install openssh-server
RUN useradd remote_user &&
echo "1234" | passwd remote_user --stdin &&
mkdir /home/remote_user/.ssh &&
chmod 700 /home/remote_user/.ssh
COPY remote-key.pub /home/remote_user/.ssh/authorized_keys
RUN chown remote_user:remote_user -R /home/remote_user/.ssh/ &&
chmod 600 /home/remote_user/.ssh/authorized_keys
RUN /usr/sbin/sshd-keygen
CMD /usr/sbin/sshd -D

Docker-compose.yml code:

version: '3'
services:
jenkins:
container_name: jenkins
image: jenkins/jenkins
ports:
- "8080:8080"
volumes:
- "$PWD/jenkins_home:/var/jenkins_home"
networks:
- net
remote_host:
container_name: remote-host
image: remote-host
build:
context: centos7
networks:
- net
networks:
net:

when I execute the "docker-compose build" command I get the following error:

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
in "./docker-compose.yml", line 5, column 12

Please help me in resolving this issue. Appreciate your help!!!
Feb 8, 2021 in Docker by Amit
• 130 points
1,478 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Docker

0 votes
1 answer

Is it possible to use JSON instead of YAML for docker-compose file?

You can use JSON instead of YAML ...READ MORE

answered Jul 2, 2019 in Docker by Sirajul
• 59,230 points
4,957 views
0 votes
1 answer

With docker compose, which parameter should I use to run a yaml file ?

Yep. Wrong command. $ docker-compose build And then run ...READ MORE

answered Oct 27, 2020 in Docker by Justin
758 views
0 votes
1 answer

Error “unable to resolve host docker”

This error occurs because its not a ...READ MORE

answered Jul 10, 2018 in Docker by Kalgi
• 2,680 points
4,873 views
0 votes
1 answer

Docker unable to connect AWS EC2 cloud

Your command is not pointing to your ...READ MORE

answered Jul 16, 2018 in Docker by Kalgi
• 52,350 points
1,517 views
0 votes
1 answer

Unable to switch filesystem to overlay in Docker in Ubuntu.

From the official docs: https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/#configure-docker-with-the-overlayoverlay2-storage-driver To configure Docker ...READ MORE

answered Jul 18, 2018 in Docker by ajs3033
• 7,300 points
2,858 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,714 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP