Skip to content

Update to Alpine 3.18 #424

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

Merged
merged 1 commit into from
May 10, 2023
Merged

Conversation

jnoordsij
Copy link
Contributor

@tianon tianon merged commit 653d21e into docker-library:master May 10, 2023
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request May 11, 2023
Changes:

- docker-library/docker@653d21e: Merge pull request docker-library/docker#424 from jnoordsij/update-alpine-3.18
- docker-library/docker@1e7a4c3: Update to Alpine 3.18
@jnoordsij jnoordsij deleted the update-alpine-3.18 branch May 11, 2023 08:51
@andythedandy
Copy link

Nice....now millions of pipelines using still docker-compose won't run anymore.

@jnoordsij
Copy link
Contributor Author

jnoordsij commented May 12, 2023

Nice....now millions of pipelines using still docker-compose won't run anymore.

I'm not sure what you mean by this, docker compose is still functional in the latest image AFAICS:

$ docker container run --rm docker:cli /bin/sh -c docker-compose --help
Usage:  docker compose [OPTIONS] COMMAND

Docker Compose

Options:
      --ansi string                Control when to print ANSI control
                                   characters ("never"|"always"|"auto")
                                   (default "auto")
      --compatibility              Run compose in backward compatibility mode
      --env-file stringArray       Specify an alternate environment file.
  -f, --file stringArray           Compose configuration files
      --parallel int               Control max parallelism, -1 for
                                   unlimited (default -1)
      --profile stringArray        Specify a profile to enable
      --project-directory string   Specify an alternate working directory
                                   (default: the path of the, first
                                   specified, Compose file)
  -p, --project-name string        Project name

Commands:
  build       Build or rebuild services
  config      Parse, resolve and render compose file in canonical format
  cp          Copy files/folders between a service container and the local filesystem
  create      Creates containers for a service.
  down        Stop and remove containers, networks
  events      Receive real time events from containers.
  exec        Execute a command in a running container.
  images      List images used by the created containers
  kill        Force stop service containers.
  logs        View output from containers
  ls          List running compose projects
  pause       Pause services
  port        Print the public port for a port binding.
  ps          List containers
  pull        Pull service images
  push        Push service images
  restart     Restart service containers
  rm          Removes stopped service containers
  run         Run a one-off command on a service.
  start       Start services
  stop        Stop services
  top         Display the running processes
  unpause     Unpause services
  up          Create and start containers
  version     Show the Docker Compose version information

Run 'docker compose COMMAND --help' for more information on a command.

@tianon
Copy link
Member

tianon commented May 12, 2023

Indeed, a little elaboration would be helpful 😅

@andythedandy
Copy link

Sorry. Yes. What you mean, is the "new" docker compose....this is indeed in there.

My CI pipelines were still using docker-compose, so they stopped working. The switch to docker compose was a no-brainer of course, but we have multiple services relying on a gitlab-ci template, that is using this command for creating an environment for integration testing.

Here you go for some context:

$ apk add --no-cache docker-compose
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
  docker-compose (no such package):
    required by: world[docker-compose]

@jnoordsij
Copy link
Contributor Author

I understand the confusion now! When running apk add --no-cache docker-compose, you are actually installing the (old v1) docker-compose binary from the Alpine package registry; however, the docker-compose plugin is already pre-installed in this image, so installing it is unnecessary.

The issue is this package is removed from Alpine as docker compose v1 is no longer supported. Note this is mostly unrelated to the docker-compose vs. docker compose syntax change, as the new v2 version still also support using docker-compose (see also my example above).

So my guess is you can remove the apk add --no-cache docker-compose from your workflow and everything should be working exactly as before, since the binary installed by apk was most likely ignored before. Alternatively, if you really need the v1 binary, you could just use alpine:3.17 as base image and install the old package (see https://pkgs.alpinelinux.org/package/v3.17/community/x86_64/docker-compose); the new binary is now installable through the docker-cli-compose package (see https://pkgs.alpinelinux.org/package/v3.18/community/x86_64/docker-cli-compose).

Tl;dr: remove apk add --no-cache docker-compose and you should most likely be fine.

@andythedandy
Copy link

andythedandy commented May 15, 2023

All cool. As I said, I just removed the "-" from the lines in the gitlab-ci.yaml and removed the line, where the docker-compose apk was installed. So it's better then before, but some of us were running in circles in panic, as we first need to find out what was wrong/what has changed ^^

@tianon
Copy link
Member

tianon commented May 15, 2023

Just to thread the needle all the way back, #361 is where docker-compose was added to the image. 😊

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.

3 participants