# Docker compose up issue

**URL:** <https://forums.docker.com/t/docker-compose-up-issue/135235>\
**Category:** General\
**Created:** [March 23, 2023, 7:27pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235 "2023-03-23T19:27:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![zavertis](https://avatars.discourse-cdn.com/v4/letter/z/8491ac/32.png) [@zavertis](https://forums.docker.com/u/zavertis)\
**Post date:** [March 23, 2023, 7:27pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/1 "2023-03-23T19:27:55Z")

</div>

docker-compose.yml  
version: “3”  
services:  
redis:  
image: redis  
application: zavertis/ocr-docker-build:tag zvaertis 60bdebacda9a8a05cbf971a427ec430bd0a588d60cfcd7ffda3c264efd6d287d  
image: dockerfacile/app  
ports:  
- 5000:5000

Hi everybody,

with the code above of my docker-compose file. I’ve downloaded an image dockerfacile/app  
But when I try to launch the command docker-compose up the error below occurs :

yaml: line 2: mapping values are not allowed in this context

I’ve scrolled some solutions but they didn’t solve my problem.  
If some have an idea, I thank him a so much.

Regards,

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [March 23, 2023, 8:04pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/2 "2023-03-23T20:04:47Z")

</div>

Please format your post according this link: [How to format your forum posts](https://forums.docker.com/t/how-to-format-your-forum-posts/127295)

---

<div class="post-metadata">

**Author:** ![zavertis](https://avatars.discourse-cdn.com/v4/letter/z/8491ac/32.png) [@zavertis](https://forums.docker.com/u/zavertis)\
**Post date:** [March 24, 2023, 8:17am UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/3 "2023-03-24T08:17:24Z")

</div>

Hi everybody,

with the code below of my docker-compose file. I’ve downloaded an image dockerfacile/app  
But when I try to launch the command docker-compose up the error below occurs :

yaml: line 2: mapping values are not allowed in this context

I’ve scrolled some solutions but they didn’t solve my problem.  
If some have an idea, I thank him a so much.

```auto

docker-compose.yml
version: “3”
services:
redis:
image: redis
application: zavertis/ocr-docker-build:tag zvaertis 60bdebacda9a8a05cbf971a427ec430bd0a588d60cfcd7ffda3c264efd6d287d
image: dockerfacile/app
ports:
- 5000:5000

```

Regards,

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [March 24, 2023, 4:55pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/4 "2023-03-24T16:55:39Z")

</div>

I am pretty sure you can see that the code you shared is not what you are actually using. You have a yaml syntax error, but if you can’t share the exact code you use, we can’t tell you for sure what the error is.

When you format your code, don’t just copy the already broken code, but share the original. @meyay suggested to edit your original post because even if we fix it for you, we can’t tell if that was the code you have used or just copied incorrectly.

As we usually say: Help us to help you.

By the way there is no “application” key ina compose file so I have no idea what that is in your file.

PS.: I removed your second topic called “Docker compose issue2”. Please, don’t create new topics for the same issue an if you create a topic, choose a proper name that describes it.

---

<div class="post-metadata">

**Author:** ![zavertis](https://avatars.discourse-cdn.com/v4/letter/z/8491ac/32.png) [@zavertis](https://forums.docker.com/u/zavertis)\
**Post date:** [March 24, 2023, 5:27pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/5 "2023-03-24T17:27:43Z")

</div>

Thank you for your contribution.  
I don’t know exactly what original code you mean but I think I’ve done an error in the username (on line application) the let’s me put below the one that I’m using.

```auto

docker-compose.yml
    version: "3"
    services: 
      redis: 
        image: redis
      application: zavertis/ocr-docker-build:tag zavertis 60bdebacda9a8a05cbf971a427ec430bd0a588d60cfcd7ffda3c264efd6d287d
        image: dockerfacile/app
        ports:
          - 5000:5000
```

Even when I change the image name dockerfacile/app by build . it does’nt work.

Regards,

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [March 24, 2023, 5:40pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/6 "2023-03-24T17:40:48Z")

</div>

I removed the indentation and commented the part that doesn’t make sense:

```auto
version: "3"
services: 
  redis: 
    image: redis
  application:
    #zavertis/ocr-docker-build:tag zavertis 60bdebacda9a8a05cbf971a427ec430bd0a588d60cfcd7ffda3c264efd6d287d
    image: dockerfacile/app
    ports:
      - 5000:5000

```

As a result it would deploy a service called `redis`, based on the image `redis:latest` with not configuration, and a service called `application`, based on the image `dockerfacile/app` and container port 5000 published to host port 5000.

We can not tell you what the commented out line is supposed to mean.

---

<div class="post-metadata">

**Author:** ![zavertis](https://avatars.discourse-cdn.com/v4/letter/z/8491ac/32.png) [@zavertis](https://forums.docker.com/u/zavertis)\
**Post date:** [March 24, 2023, 5:47pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/7 "2023-03-24T17:47:42Z")

</div>

Well at the beginning, there were nothing in front of application.  
But after encountering error when trying to execute docker-compose up, I saw somewhere in the net some suggest me to put the line you have commented.  
So It was like this :

```auto
docker-compose.yml
    version: "3"
    services: 
      redis: 
        image: redis
      application: 
        image: 
        ports:
          - 5000:5000
```

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [March 24, 2023, 5:54pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/8 "2023-03-24T17:54:47Z")

</div>

Can’t have been like that either, as there is no `image` used, which makes it still not a valid compose file.

What do you want to achieve? What is the big picture here?

Note: adding the filename into the preformatted text block, and adding extra indentation is to separate the filename from the content, does more harm than good.

---

<div class="post-metadata">

**Author:** ![zavertis](https://avatars.discourse-cdn.com/v4/letter/z/8491ac/32.png) [@zavertis](https://forums.docker.com/u/zavertis)\
**Post date:** [March 24, 2023, 6:01pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/9 "2023-03-24T18:01:17Z")

</div>

Ok; I change it. I’m beginner, I’m learning Docker troughout a tutorial. The purpose of the code below is to create a docker-compose file to manage container that I need to create.

```auto
version: "3"
services: 
  redis: 
    image: redis
  application: 
    image: dockerfacile/app
    ports:
      - 5000:5000
```

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [March 24, 2023, 6:03pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/10 "2023-03-24T18:03:50Z")

</div>

It should work with the lastest compose file you shared.

---

<div class="post-metadata">

**Author:** ![zavertis](https://avatars.discourse-cdn.com/v4/letter/z/8491ac/32.png) [@zavertis](https://forums.docker.com/u/zavertis)\
**Post date:** [March 24, 2023, 6:05pm UTC](https://forums.docker.com/t/docker-compose-up-issue/135235/11 "2023-03-24T18:05:45Z")

</div>

It’s ok know.

Thank so much.
