简体   繁体   中英

What is wrong with my docker-compose.yml?

Seems like it is a error in my yml file. I read a lot of articles here but found nothing. I still cannot get it to work. I purposely removed some unnecessary parts of my code, so here it is:

version: '3.3'
services:
  shop:
    image: azamatibraimov/repository:shop
    restart: always
    ports:
      - 8080:8080
    expose:
      - '8080'
    depends_on:
      - db
  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: 'mydb'
      MYSQL_ROOT_PASSWORD: '123'
    ports:
      - '3306:3306'

So,When I do this:

docker login && docker-compose up

I have this output:

ERROR: manifest for azamatibraimov/repository:shop not found

What or where is the shop:latest docker image? Is this something that you are trying to build locally? If so, add the following to your shop service:

shop:
  build:
    context: .
  image: shop:latest
  …

As context, put the folder where the Dockerfile for the shop is located.

I'm assuming that you pushed the image to a docker hub. azamatibraimov/repository:shop Is this the right docker image name?

To pull the image, the correct syntax is: username/repositoryname:tagname

Default tag name is "latest". So, if you left it blank when you pushed image, this could be your correct image name: azamatibraimov/repository:latest

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM