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

[BUG] gradle build: docker integration doesn't work if not installed in default location (or using CLI instead) #4883

Open
rursprung opened this issue Oct 24, 2022 · 0 comments
Labels
feature New feature or request

Comments

@rursprung
Copy link
Contributor

Describe the bug
the current implementation assumes that docker and docker-compose can be found in specific paths:

private static String[] DOCKER_BINARIES_UNIX = { "/usr/bin/docker", "/usr/local/bin/docker" };
private static String[] DOCKER_BINARIES_WINDOWS = { System.getenv("PROGRAMFILES") + "\\Docker\\Docker\\resources\\bin\\docker.exe" };
private static String[] DOCKER_BINARIES = Os.isFamily(Os.FAMILY_WINDOWS) ? DOCKER_BINARIES_WINDOWS : DOCKER_BINARIES_UNIX;
private static String[] DOCKER_COMPOSE_BINARIES_UNIX = { "/usr/local/bin/docker-compose", "/usr/bin/docker-compose" };
private static String[] DOCKER_COMPOSE_BINARIES_WINDOWS = {
System.getenv("PROGRAMFILES") + "\\Docker\\Docker\\resources\\bin\\docker-compose.exe" };

however, this is not always the case:

  • the applications could be installed in non-default paths
  • Docker CLI could be installed instead (with the docker daemon running on a server instead of locally)
  • maybe other use-cases i'm not aware of

in those cases it's currently not possible to build the docker images.

To Reproduce
n/a

Expected behavior
the build system is agnostic to the exact location or type of installation of docker and works with all valid setups.

Plugins
n/a

Screenshots
n/a

Host/Environment (please complete the following information):
encountered this on Windows 10 with Docker CLI and a remote docker daemon

Additional context
i'd strongly suggest to not do this by calling external applications yourself but instead use a gradle plugin for this. namely, gradle-docker-plugin could be used for this and based on the documentation there i've now found that also gradle-docker-compose-plugin exists and could be used.

@rursprung rursprung added bug Something isn't working untriaged labels Oct 24, 2022
@minalsha minalsha added feature New feature or request and removed bug Something isn't working untriaged labels Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants