Docker-compose example command when trying out

Dear All,
When trying out the training instruction for docker-compose I ma getting access denied message

docker run -d --name=vote -p 5000:80 --link redis:redis voting-app
Unable to find image ‘voting-app:latest’ locally
docker: Error response from daemon: pull access denied for voting-app, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied.

I have given the docker login credentials correctly
Joseph John

In the next chapter, explaining “example of voting application,” , they are explaining how to do it
We need to compile the image for us, it cannot be pulled from the hub directly. The three application we have to build the images
As mentioned in the video, we can get the dockerfile from the location

yes, you should build the images locally to be able to use it directly using docker run voting-app. or you can build/push them to dockerhub, then use dockerhubUsername/imageName to be able pull them from the dockerhub. When you tried docker run voting-app, the docker engine tr to pull voting-app image from dockerhub which is doesn’t exist.

Hi joseph.john,

Please try this:

controlplane $ cat docker-compose.yaml

version: "3"
  image: redis

  image: postgres
  #image: postgres:9.4
    - POSTGRES_PASSWORD=postgres

  image: kodekloud/examplevotingapp_vote:v1
  #image: kodekloud/examplevotingapp_vote
  #image: voting-app
    - 5000:80

  image: kodekloud/examplevotingapp_worker
  #image: worker-app

  image: kodekloud/examplevotingapp_result:v1
  #image: kodekloud/examplevotingapp_result
  #image: result-app
   - 5001:80

controlplane $

controlplane $ docker-compose up -d

39ab52e8f5a3: Pull complete
09a3e8e68b7c: Pull complete
Digest: sha256:41602fb80ac1042e331c8886e28bd5f424eab546650a471434636c457f2dbd79
Status: Downloaded newer image for kodekloud/examplevotingapp_result:v1
Creating root_result_1 ... done
Creating root_db_1     ... done
Creating root_vote_1   ... done
Creating root_worker_1 ... done
Creating root_redis_1  ... done

controlplane $
controlplane $ docker ps -a

CONTAINER ID   IMAGE                                  COMMAND                  CREATED          STATUS                     PORTS                                   NAMES
84533088f83f   kodekloud/examplevotingapp_worker      "/bin/sh -c 'dotnet …"   19 seconds ago   Exited (1) 7 seconds ago                                           root_worker_1
3cef1ffd5b6d   redis                                  "docker-entrypoint.s…"   19 seconds ago   Up 13 seconds              6379/tcp                                root_redis_1
0dc58c67776a   postgres                               "docker-entrypoint.s…"   19 seconds ago   Up 13 seconds              5432/tcp                                root_db_1
09b5c884a413   kodekloud/examplevotingapp_vote:v1     "gunicorn app:app -b…"   19 seconds ago   Up 13 seconds    >80/tcp, :::5000->80/tcp   root_vote_1
f0efc4bb4202   kodekloud/examplevotingapp_result:v1   "docker-entrypoint.s…"   19 seconds ago   Up 15 seconds    >80/tcp, :::5001->80/tcp   root_result_1

controlplane $

You may refer kodekloud images here: Docker Hub