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

Was curl removed in the latest minio image? #18373

Closed
harupy opened this issue Nov 2, 2023 · 10 comments
Closed

Was curl removed in the latest minio image? #18373

harupy opened this issue Nov 2, 2023 · 10 comments

Comments

@harupy
Copy link

harupy commented Nov 2, 2023

NOTE

If this case is urgent, please subscribe to Subnet so that our 24/7 support team may help you faster.

I'm not sure if this is a bug, but it looks like curl was removed in the latest minio image:

# has curl
# FROM minio/minio:RELEASE.2023-10-25T06-33-25Z

# doesn't
FROM minio/minio:RELEASE.2023-11-01T18-37-25Z

RUN curl --version

Build output:

> docker build .
[+] Building 0.8s (5/5) FINISHED                                                                                                                                                                              
 => [internal] load .dockerignore                                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                                          0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                     0.0s
 => => transferring dockerfile: 175B                                                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/minio/minio:RELEASE.2023-11-01T18-37-25Z                                                                                                                      0.6s
 => CACHED [1/2] FROM docker.io/minio/minio:RELEASE.2023-11-01T18-37-25Z@sha256:8871650797a40e6094828e86709f3e7180615f03d72ea9d385a720dfb2b63510                                                         0.0s
 => ERROR [2/2] RUN curl --version                                                                                                                                                                       0.2s
------
 > [2/2] RUN curl --version:
#0 0.207 /bin/sh: line 1: curl: command not found
------
Dockerfile:7
--------------------
   5 |     FROM minio/minio:RELEASE.2023-11-01T18-37-25Z
   6 |     
   7 | >>> RUN curl --version
   8 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c curl --version" did not complete successfully: exit code: 127

I found this while investigating mlflow/mlflow#10268 where one of our tests failed because healthcheck with test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] is faling.

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

Regression

Your Environment

  • Version used (minio --version):
  • Server setup and configuration:
  • Operating System and version (uname -a):
@jiuker
Copy link
Contributor

jiuker commented Nov 2, 2023

#18313 We have replaced the base image.

@harupy
Copy link
Author

harupy commented Nov 2, 2023

@jiuker Thanks for the quick reply! What command can I use for healthcheck?

@harshavardhana
Copy link
Member

Yes we moved to UBI micro that does not ship curl you can use this instead

    healthcheck:
      test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
      interval: 5s
      retries: 1
      start_period: 5s
      timeout: 5s

@harupy
Copy link
Author

harupy commented Nov 2, 2023

@harshavardhana It worked, thanks!

@serut

This comment was marked as outdated.

@harshavardhana
Copy link
Member

Don't do what is recommended here ^^ - embrace mc ready local

@shouburu
Copy link

shouburu commented Nov 3, 2023

Don't do what is recommended here ^^ - embrace mc ready local

Doesn't work for me. Getting "The cluster is not ready" but everything seems fine and usable.

@harshavardhana
Copy link
Member

Don't do what is recommended here ^^ - embrace mc ready local

Doesn't work for me. Getting "The cluster is not ready" but everything seems fine and usable.

Or use this

    healthcheck:
      test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
      interval: 5s
      retries: 1
      start_period: 5s
      timeout: 5s

emmiegit added a commit to scpwiki/wikijump that referenced this issue Nov 4, 2023
See minio/minio#18373 (comment).
Breaking change in upstream minio container.

Instead of replacing the healthcheck everywhere, we're moving it to a
script instead so that one place can be called, and if the healthcheck
is ever updated in the future, we only need to do so in one place.
@rotten
Copy link

rotten commented Dec 20, 2023

If you use mc ready local and you are not running on the default port, it won't work out of the box. The local alias defaults to the default port regardless of what the minio server options are that start the container.

There doesn't appear to be a way to pass the port into the mc command without setting an Alias. So you have to update the alias for local somehow when the container comes up.

The default docker-entrypoint style of starting the container doesn't let you run the mc alias set command on startup.

I tried setting the alias every single time the healthcheck ran, but that didn't work, I'm not sure exactly why. It appears that the first time mc runs it needs to do some intialization and that initialization doesn't seem to work from the healthcheck command.

By default the alias is found in the /tmp/.mc/config.json folder. You can move this around by setting MC_CONFIG_DIR as an environment variable. You can replace that with a volume mount and pre-configure it. (That is what I'm working on setting up now.)

Or, don't use the off-the-shelf image, or never change from the default port. :-(

@rotten
Copy link

rotten commented Dec 20, 2023

FWIW, volume mounting just the customized config.json does the trick.

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

No branches or pull requests

6 participants