How to use local docker images in convox?

201 Views Asked by At

Is it possible to use local docker image in convox compose.yml , that has not been pushed yet . I want to maintain tags for images locally and use them in my docker-compose.yml. I do not want to store images on cloud.

My docker-compose.yml looks like this:

web:
    build: .
    environment:
      - SECRET_KEY=fjf!ue+)%6bjxv&&07g@ko6+@p0xviv_02pxdams-+9@o=dvo(
      - FOO=testing
      - DB_HOST=db_test_host
      - DB_PORT=testing_port
      - PLATFORM_HOST=192.168.10.2
      - PYTHONUNBUFFERED=TRUE
    volumes:
      - /home/mahesh/projects/django/tmp/static:/app/static
    links:
      - database
    ports:
      - 8000:8000
      - 443:4001

What i want is to use image , something like this:

   db:
     image: 406018032378.dkr.ecr.us-west-2.amazonaws.com/tap/docker-mysql:latest

But here i want to use my local image. Is it possible ?

1

There are 1 best solutions below

0
On

Can you run a local image in Convox?

No.

Convox uses Amazon's ECS behind the scenes to run a docker image as a Task. Check the Task Definition Parameters docs to see the image is referenced with a string, which points to an image in some Docker repository.

Are there alternatives

Yes. Depends on what you want.

  • Run a docker repository locally. Technically you could do it by exposing the local docker repository and configure convox to use that. Overkill in my opinion.
  • Use a repo in Docker Hub. Build the image and push it there. You could either set the repo as public or private, depending on your needs.
  • When you build, also push to Amazon's ECR.

You'll need to go into more details of why you're trying to do this, we can probably suggest a better solution.