Closed amit2793 closed 3 years ago
i was able to fix the above error however , now i am getting following error
[jenkins@localhost jenkins-data]$ docker-compose build ERROR: In file './docker-compose.yml', service must be a mapping, not a NoneType.
Note: code is same
Please provide service type... Which type you want it
Also refer here https://docs.docker.com/compose/
Please provide service type... Which type you want it
Thank you for your response.This code was working fine previously, the issue started only after entering the following code.
remote_host: container_name: remote-host image: remote-host build: context: centos7 networks:
With the help of above code what i am trying to achieve is to create a docker Machine with ssh service.
Also, could you please let me know what service type need to be given?
Please check the docs you will get more info...
it was issue an with indentation and spaces given while creating docker-compose.yml
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:
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!!!
@shaikkhajaibrahim santhoshd402