skip to Main Content

I’m a newbie to Docker and am running into problems running a Docker hosted app with multiple containers, that I inherited from another developer. This docker setup is working fine on a cloud server, however, when I try to install and run it locally then I’m getting errors.

When I run the "docker ps" command on the cloud server, here’s what I’m getting:

CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS                                      NAMES
c1fbb8968c89        app_eserver            "nginx -g 'daemon of…"   3 weeks ago         Up 34 hours         0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   server
85be26cfd761        auction                "/usr/local/bin/uwsg…"   2 years ago         Up 34 hours         8092/tcp                                   auction-backend
6d2c1ad52ef0        redis:4-alpine         "docker-entrypoint.s…"   2 years ago         Up 3 weeks          6379/tcp                                   redis
94417f94d374        postgres:10.0-alpine   "docker-entrypoint.s…"   2 years ago         Up 3 weeks          5432/tcp                                   db

As I understand, the above means that there are 4 containers running the app. Within the directory structure, there is a docker-compose.yml file and 2 Dockerfiles (one in the nginx folder and the other in the folder with the code). There are no Dockerfiles for redis and postgres.

When I try to build using the docker-compose.yml file then I get the following error:

ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling backend (auction:)...
ERROR: pull access denied for auction, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

When I try to build the app Dockerfile, it throws a build error.

When I try to build the nginx Dockerfile, it builds but quits the container immediately after running.

I have read a whole bunch on the topic, but I’m unable to figure out how to run this locally on my machine. Any pointers would be really appreciated.

Here’s my docker-compose.yml file:

eserver:
  container_name: server
  build: nginx
  restart: always
  ports:
    - "80:80"
    - "443:443"
  links:
    - backend
  volumes_from:
    - backend

backend:
  container_name: auction-backend
  image: auction
  hostname: auction-backend
  restart: always
  env_file: .env
  external_links:
    - db
    - redis
  volumes:
    - appmedia:/app/auction/media

Here’s the nginx Dockerfile:

FROM nginx:1.15-alpine

RUN rm /etc/nginx/conf.d/*
COPY auction.conf /etc/nginx/conf.d/

Here’s the app Dockerfile:

FROM python:2.7-alpine

RUN apk update && apk add 
        postgresql-dev 
        python3-dev 
        gcc 
        jpeg-dev 
        zlib-dev 
        musl-dev 
        linux-headers && 
        mkdir app

WORKDIR /app/

# Ensure that Python outputs everything that's printed inside
# the application rather than buffering it.
ENV PYTHONUNBUFFERED 1

ADD . /app

RUN if [ -s requirements.txt ]; then pip install -r requirements.txt; fi
EXPOSE 8092
VOLUME /app/auction/assets
ENTRYPOINT ["/usr/local/bin/uwsgi", "--ini", "/app/uwsgi.ini"]

Here’s my directory structure:

├── app
│   ├── docker-compose.yml
│   └── nginx
│       ├── Dockerfile
│       └── auction.conf
├── auction-master
│   ├── Dockerfile
│   ├── LICENSE.txt
│   ├── README.rst
│   ├── auction
│   │   ├── accounts
│   │   ├── auction
│   │   ├── common
│   │   ├── django_messages
│   │   ├── employer
│   │   ├── log_activity
│   │   ├── manage.py
│   │   ├── notifications
│   │   ├── provider
│   │   ├── static
│   │   ├── templates
│   │   ├── admin
│   │   └── unidecode
│   ├── requirements
│   │   ├── base.txt
│   │   ├── local.txt
│   │   ├── production.txt
│   │   └── test.txt
│   ├── requirements.txt
│   └── uwsgi.ini

2

Answers


  1. Chosen as BEST ANSWER

    I was able to run it locally simply by downloading the containers themselves.


  2. According to your error message, it’s possible that your Dockerfile is trying to pull a private image.

    The reason everything works normally on the cloud but local can not be that docker on the cloud has been logged into an account that has access to the image above.

    Now you just need to docker login to the account that has been logged in the cloud, everything can be up and running again.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search