Docker compose with ubuntu does not work

0

I'm doing a docker-compose.yml with the following content, but the result is an exited code 1.

web:
  image: ubuntu

Trying another image works, but less with ubuntu or debian

    
asked by millan2993 28.12.2017 в 19:43
source

2 answers

0

I am not sure that the content is appropriate for the compose, you must declare a version and web should be within the services section. Therefore, the content of your file should look something like this:

version: '2'

services:
  web:
    image: ubuntu 

Then try doing the build :

$ docker-compose build
    
answered by 14.02.2018 в 00:06
0

You need to add the version to .yaml and the type of service. For an image of ubuntu would be something like this:

version: 3
services:
ubuntu:
image: ubuntu:rolling
    
answered by 19.02.2018 в 19:25