docker-compose-wait
docker-compose-wait copied to clipboard
Can you provide a lightweight docker image?
Hi,
I would like to know if you can provide an auto updated docker image on dockerhub for example that can be directly used on any system running docker?
For example, I often use https://hub.docker.com/r/waisbrot/wait to wait for other containers directly on shell scripts.
What do you think about it?
Best regards, Alexandre.
Hi @Its-Alex, indeed I could, but honestly, as the primary use case for this tool is to be easily importable while building your custom image, I am not sure what base image I should use for it.
@Its-Alex I believe it would be even ligther if simply copy or download the built binary to the final image
Example:
FROM any-distro
COPY mystuff in-my-image
RUN my-crazy-commands
RUN install-curl && /
curl docker-compose-wait-binary && /
chmod +x docker-compose-wait-binary && /
uninstall curl
...
Since you're using the same architecture (x86_64, ARM) during the build I think you wont have problems
Can you try this on your projects and give some feedback?
@edumco how is this linked to #50?
Oh sorry. I confused the issues
@ufoscout The lightweight image has possible, like alpine or even scratch if possible. My aim is to use this image with configurations where I can't modify docker container and I want to have as little as possible dependencies.
For example when using https://docs.docker.com/compose/extends/ I can use an image that wait for another container in shell scripts. At initialization this is very useful to manually launch a database migration.
@ufoscout The lightweight image has possible, like alpine or even scratch if possible. My aim is to use this image with configurations where I can't modify docker container and I want to have as little as possible dependencies.
For example when using https://docs.docker.com/compose/extends/ I can use an image that wait for another container in shell scripts. At initialization this is very useful to manually launch a database migration.
You want to create a small image so instead you modify your containers you create a container that waits to call another container?
Can you detail this data base example?
FROM alpine AS wait
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait
RUN chmod +x /wait
# using
COPY --from=wait /wait ./wait
@Its-Alex The solution provided by @minho-comcom-ai solved your needs?
@ufoscout I believe this might be solved by updating the documentation with more examples. What do you think?
@Its-Alex The solution provided by @minho-comcom-ai solved your needs?
Yes but this would be awesome if the docker image can be maintained directly by a CI in this repo. What I ask in this issue.
This will be a lot easy to use, and update. And allow all community to directly use updated docker image.
@Its-Alex Have you ever tryed to create a Pull Request?
I could review and create the pipeline, what do you think?
@ufoscout @edumco I made a PR with an example of what I would like to see with this issue. Can you check it and tell me what I need to improve?
PS: Sorry for my late answer :pray:
@Its-Alex thanks, I'll have a look at it. Anyway, this issue is not for a dockerfile example but to have an official image pushed in dockerhub
@ufoscout Up ?
@ufoscout Have you take time to look at the PR?
@Its-Alex I did, but the PR did not solve this issue
@ufoscout My PR is dated from 2021 at this time there was no Dockerfile
(added on July 2022 in https://github.com/ufoscout/docker-compose-wait/commit/36501adb3917d13cab37b38144cd61bdfe11a041). Moreover, this is a test Dockerfile.
In this issue I speak about a lightweight docker image built by Github action, hosted on a free repository that can be downloaded by anyone at anytime without need to host their own image.
By curiosity, can you tell me the reason for refusing my PR? docker-compose.yml
was for test purpose :confused:
By curiosity, can you tell me the reason for refusing my PR? docker-compose.yml was for test purpose
It was redundant as there is already a docker-compose example
How about multi-platform images (built on top of scratch
) that contain only the wait
file? With this approach, we can use just one line of COPY --from...
command, and it will automatically adapt to the target platform. For example, when building an image on an aarch64 machine, the aarch64 variant of wait
would be gotten along with the file permission information.
Here's the usage to reflect this change:
- ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.11.0/wait /wait
- RUN chmod +x /wait
+ COPY --from=ghcr.io/ufoscout/docker-compose-wait:2.11.0 /wait /wait
I have also suggested a PR (https://github.com/ufoscout/docker-compose-wait/pull/75) for this.
Fixed by #75