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

Try to auto-detect docker or podman binary #1017

Closed

Conversation

ssiegel
Copy link
Contributor

@ssiegel ssiegel commented Oct 30, 2023

No description provided.

@firecow
Copy link
Owner

firecow commented Oct 31, 2023

Increasing upstart time for the majority of developers is a bad idea i feel..

Let's add a podman section to the readme instead, explaining how to use --container-executable, when you wanna use podman.

The autodetection will only run the first time the container executable
is requested. In that case we're going to run the container executable
multiple times anyway, so the additional `docker version` startup call
should be negligible.
@ssiegel
Copy link
Contributor Author

ssiegel commented Nov 1, 2023

I totally see the point, and I agree that adding the autodetection is indeed quite heavy to add to every start, when it might not be needed, e.g. when just using the shell executor or autocompletion.

My main issue is that without a global configuration file, it is inconvenient to always have to add the --container-executable option. To define a shell alias for that doesn't look like the correct solution to me. I realize now that I can set the GCL_CONTAINER_EXECUTABLE environment variable, which is better, but maybe there is an automatic way without the startup impact for the most common case:

I updated the pull request to run the container executable autodetection only if we need it. Then we're going to run docker multiple times anyway (17 docker invocations in the following minimal hello world .gitlab-ci.yml). Adding a single docker version to that looks reasonable to me.

hello-world:
  image: alpine:latest
  script:
    - echo "hello world"

@ssiegel
Copy link
Contributor Author

ssiegel commented Nov 1, 2023

I'm sorry, I totally missed the fact that it's possible to put global configuration into ~/.gitlab-ci-local/.env, which completely solves my initial problem. So feel free to either just close this pull request, or use it if you agree that it might be useful for gitlab-ci-local to just work out of the box with just podman installed, without docker symlink.

@firecow
Copy link
Owner

firecow commented Nov 2, 2023

I don't agree that all docker executor jobs should be have increased upstart time, when its so "easy" to add a export GCL_CONTAINER_EXECUTABLE=pod in .bashrc or use the ~/.gitlab-ci-local/.env 😄

Closing, but thanks for the other PR's, good job !!!

@firecow firecow closed this Nov 2, 2023
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

Successfully merging this pull request may close these issues.

2 participants