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

DOCKER_HOST-strategy in class isDockerWorking.java excludes expected "unix:"-path where it should include "unix:" - broken. #29426

Closed
janderssonse opened this issue Nov 22, 2022 · 9 comments · Fixed by #29562
Labels
area/container-image kind/bug Something isn't working
Milestone

Comments

@janderssonse
Copy link
Contributor

janderssonse commented Nov 22, 2022

Describe the bug

In the file
IsDockerWorking.java.
line 129 -see https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/IsDockerWorking.java#L129

the check for the DOCKER_HOST-variable is negatated. However, setting the DOCKER_HOST variable to a unix socket usually involves a path like "unix:\\the\path\to\socket". This is also clearly mentioned and recommened in your documentation -> https://quarkus.io/guides/podman#setting-docker_host-on-linux. The negation should most likely be removed so that the logic it now hides can run correctly (connection to the "unix:" socket in the DOCKER_HOST-env.

Expected behavior

It should find a DOCKER_HOST-path (according to practices, according to your documentation linked in descrioption starting with unix:\\the-path-to-the-socket.

Actual behavior

It instead excludes DOCKER_HOST paths starting with "unix:" due to starting with neg !.

How to Reproduce?

Set a DOCKER_HOST starting with "unix:\" for example as per docu, qurkus will fail finding it and connecting to it . https://quarkus.io/guides/podman#setting-docker_host-on-linux

Output of uname -a or ver

No response

Output of java -version

17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.13.4

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@janderssonse janderssonse added the kind/bug Something isn't working label Nov 22, 2022
@janderssonse janderssonse changed the title Strategy for looking after DOCKER_HOST in class isDockerWorking.java exclude expected "unix:" where it should include "unix:" DOCKER_HOST-strategy in class isDockerWorking.java excludes expected "unix:"-path where it should include "unix:" - broken. Nov 22, 2022
@geoand
Copy link
Contributor

geoand commented Nov 23, 2022

@Sanne you seem to have added the !dockerHost.startsWith("unix:") check in 7dc7475 to make Podman work.
Do you know if it's still needed?

@janderssonse
Copy link
Contributor Author

janderssonse commented Nov 23, 2022

@geoand If the logic is correct then the documentation is wrong - It says to set this as

export DOCKER_HOST=unix:///run/user/${UID}/podman/podman.sock

https://quarkus.io/guides/podman#setting-docker_host-on-linux which makes perfectly sense. I would in practice still argue that it is the !dockerHost.startsWith("unix:") that should not have an !

@geoand
Copy link
Contributor

geoand commented Nov 23, 2022

I'll let @Sanne comment as I have never used podman

@janderssonse
Copy link
Contributor Author

I'll let @Sanne comment as I have never used podman

Thanks, note though that one does not have to run Podman though to see that the documentation line refered and the condition logic contradicts each other.

@geoand
Copy link
Contributor

geoand commented Nov 23, 2022

I agree, I just don't know which one is wrong :)

@Sanne
Copy link
Member

Sanne commented Nov 23, 2022

Sorry I don't remember why we did this. I can check/validate any changes with podman though, if that helps.

@geoand
Copy link
Contributor

geoand commented Nov 23, 2022

That would be great, thanks

@janderssonse
Copy link
Contributor Author

janderssonse commented Nov 23, 2022

Thanks @Sanne . Heads up, Another note is that the current documentation example mentioned above for setting DOCKER_HOST is also pointing to a podman socket path that might differ on different setups of linuxes. To see which is the correct path for your podman instance see

podman info | grep -A2 'remote'

and you should get roughly like
bild

back which shows the correct podman socket path - ie set DOCKER_HOST=unix://THE_ABOVE_PATH. (Also exists should be true.)

gsmet added a commit to gsmet/quarkus that referenced this issue Nov 29, 2022
gsmet added a commit to gsmet/quarkus that referenced this issue Nov 29, 2022
@gsmet
Copy link
Member

gsmet commented Nov 29, 2022

I created #29562 to take care of this.

@quarkus-bot quarkus-bot bot added this to the 2.16 - main milestone Dec 2, 2022
@gsmet gsmet modified the milestones: 2.16 - main, 2.15.0.Final Dec 2, 2022
gsmet added a commit to gsmet/quarkus that referenced this issue Dec 2, 2022
@gsmet gsmet modified the milestones: 2.15.0.Final, 2.14.3.Final Dec 2, 2022
gsmet added a commit to gsmet/quarkus that referenced this issue Dec 2, 2022
@gsmet gsmet modified the milestones: 2.14.3.Final, 2.13.6.Final Dec 14, 2022
gsmet added a commit to gsmet/quarkus that referenced this issue Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/container-image kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants