Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-arch support specially arm64 #176

Open
farhad-ris opened this issue Apr 13, 2022 · 2 comments
Open

Multi-arch support specially arm64 #176

farhad-ris opened this issue Apr 13, 2022 · 2 comments

Comments

@farhad-ris
Copy link

Is it possible to add multi-arch support specially ARM compatibility so we can benefit from AWS Graviton, and faster dev on Apple Silicon Macs

@ezintz
Copy link

ezintz commented Oct 15, 2022

I've just forked the repository and integrated a GitHub workflow for multi-platform build. Feel free to try it out yourself https://hub.docker.com/r/ezintz/dockerize/tags.

Tried it for a couple of images and it worked just fine.

@blimmer
Copy link

blimmer commented Mar 2, 2023

I ran into this and was able to get rid of dockerize by using the built-in docker-compose healthcheck and depends_on configurations.

Previous Config

version: "3.1"
services:
  db:
    build:
      context: .
      dockerfile: ./db.dockerfile
    ports:
      - 5434:5432

  db-wait:
    image: jwilder/dockerize
    command: dockerize -wait tcp://db:5432 -timeout 1m
    depends_on:
      - db

And if I wanted to wait for the db I'd do:

docker-compose up db-wait

New Config

Instead, I can now do:

version: "3.1"
services:
  db:
    build:
      context: .
      dockerfile: ./db.dockerfile
    ports:
      - 5434:5432
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5

and:

docker-compose up --wait db

For me, this was better than trying to figure out how to keep using dockerize. In fact, this is better than what I had before, before it doesn't just test the TCP port, it actually uses the pg_isready command to make sure postgres is ready for connections 😄

For other services that depend on the service with the healthcheck, you do need to specify that you want to wait for the service to be healthy. For example:

version: "3.1"
services:
  db:
    build:
      context: .
      dockerfile: ./db.dockerfile
    ports:
      - 5434:5432
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5
  tests:
    build:
      context: .
      dockerfile: ./tests.dockerfile
    depends_on:
      db:
        condition: service_healthy

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants