GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support downloading binaries from docker images by vvoland · Pull Request #106 · docker/setup-docker-action

Conversation

@vvoland

@vvoland vvoland commented Sep 9, 2024

Copy link
Copy Markdown
Contributor
  • needs: docker/install: Support version: master actions-toolkit#438

This patch extends the version input parameter to also accept an CSV-style options allowing to specify a different installation source of the docker binaries:

  1. archive (old and still default) - fetches static binaries from download.docker.com
  • type - must be archive
  • version - a Docker version to install (example: v27.2.1) or latest (last stable release)
  • channel - a channel to install from (test or stable)
  1. image (new) - fetches binaries from the moby/moby-bin and dockereng/cli-bin repositories
  • type - must be image
  • tag - a tag of the image, can either use a tagged version like 27.2.1 or a branch name like master.

Some examples:

  version: latest                                      # install last stable released version
  version: 27.2.1                                      # install v27.2.1 from download.docker.com
  version: type=archive                          # same as above
  version: version=27.2.1                        # same as above
  version: type=archive,version=27.2.1  # same as above

  version: type=archive,version=27.3.0-rc.1,channel=test # install v27.3.0-rc.1 from test channel
 
  version: type=image                             # install last stable released version from bin images
  version: type=image,tag=latest           # same as above

  version: type=image,tag=master            # install a cutting-edge version from the `master` branch
  version: type=image,tag=27.2.1              # install v27.2.1

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vvoland vvoland mentioned this pull request Sep 9, 2024
docker/install: Support version: master docker/actions-toolkit#438
Merged
crazy-max
crazy-max reviewed Sep 9, 2024
View reviewed changes
Comment thread src/context.ts Outdated
Comment on lines +29 to +74
if (version.indexOf('=') !== -1) {
const csv = version.split(',');
for (const c of csv) {
const kv = c.split('=');
values.set(kv[0], kv[1]);
}
} else {
values.set('type', 'archive');
values.set('version', version);
}

@crazy-max crazy-max Sep 9, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can rely on https://www.npmjs.com/package/csv-parse library like we do in https://github.com/docker/actions-toolkit/blob/2eba5d9d103d5a314b8dcfada334a3cca52459ad/src/buildx/build.ts#L201-L217 or the metadata-action:

  • https://github.com/docker/metadata-action/blob/60a0d343a0d8a18aedee9d34e62251f752153bdb/src/tag.ts#L88
  • https://github.com/docker/metadata-action/blob/60a0d343a0d8a18aedee9d34e62251f752153bdb/src/flavor.ts#L22-L75

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vvoland
vvoland force-pushed the binimg branch from 2da2161 to 3c50466 Compare October 22, 2024 16:00
@vvoland
vvoland marked this pull request as ready for review October 28, 2024 09:23
@vvoland
vvoland force-pushed the binimg branch from 3c50466 to 2f969b0 Compare October 28, 2024 09:24
@crazy-max

crazy-max commented Oct 29, 2024

Copy link
Copy Markdown
Member

@vvoland #122 just got merged, you can rebase

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vvoland
vvoland force-pushed the binimg branch from 2f969b0 to e638bdc Compare October 29, 2024 15:59
crazy-max
crazy-max requested changes Oct 29, 2024
View reviewed changes

@crazy-max crazy-max left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some tests fail: https://github.com/crazy-max/ghaction-setup-docker/actions/runs/11577764011/job/32229933906?pr=106#step:3:274

also missing dist generation: docker buildx bake pre-checkin, see https://github.com/crazy-max/ghaction-setup-docker/blob/master/.github/CONTRIBUTING.md#submitting-a-pull-request

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vvoland reacted with eyes emoji
All reactions
  • 👀 1 reaction
@vvoland
vvoland force-pushed the binimg branch from e638bdc to 0ce9ccc Compare October 29, 2024 16:08
@vvoland
Support downloading binaries from docker images
cd5049a
Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland
vvoland force-pushed the binimg branch from 0ce9ccc to cd5049a Compare October 29, 2024 16:37
@crazy-max

crazy-max commented Oct 29, 2024

Copy link
Copy Markdown
Member

@vvoland Added extra commit to test type=image,tag=latest in GHA and seems we don't use the actual version neither when downloading systemd units: https://github.com/crazy-max/ghaction-setup-docker/actions/runs/11582762974/job/32246484640?pr=106#step:5:2171

[  298.001262] cloud-init[2118]: + wget https://raw.githubusercontent.com/moby/moby/latest/contrib/init/systemd/docker.service https://raw.githubusercontent.com/moby/moby/vlatest/contrib/init/systemd/docker.service -O /etc/systemd/system/docker.service
[  298.040071] cloud-init[2118]: --2024-10-29 21:52:40--  https://raw.githubusercontent.com/moby/moby/latest/contrib/init/systemd/docker.service
[  299.046101] cloud-init[2118]: Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
[  299.082724] cloud-init[2118]: Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
[  299.202189] cloud-init[2118]: HTTP request sent, awaiting response... 404 Not Found
[  299.216292] cloud-init[2118]: 2024-10-29 21:52:41 ERROR 404: Not Found.
[  299.226332] cloud-init[2118]: --2024-10-29 21:52:41--  https://raw.githubusercontent.com/moby/moby/vlatest/contrib/init/systemd/docker.service
[  299.244670] cloud-init[2118]: Reusing existing connection to raw.githubusercontent.com:443.
[  299.313128] cloud-init[2118]: HTTP request sent, awaiting response... 404 Not Found
[  299.328273] cloud-init[2118]: 2024-10-29 21:52:41 ERROR 404: Not Found.
[  299.345236] cloud-init[2118]: + true
[  299.354731] cloud-init[2118]: + wget https://raw.githubusercontent.com/moby/moby/latest/contrib/init/systemd/docker.socket https://raw.githubusercontent.com/moby/moby/vlatest/contrib/init/systemd/docker.socket -O /etc/systemd/system/docker.socket
[  299.386189] cloud-init[2118]: --2024-10-29 21:52:41--  https://raw.githubusercontent.com/moby/moby/latest/contrib/init/systemd/docker.socket
[  300.347605] cloud-init[2118]: Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.108.133, 185.199.110.133, ...
[  300.373431] cloud-init[2118]: Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
[  300.471471] cloud-init[2118]: HTTP request sent, awaiting response... 404 Not Found
[  300.487020] cloud-init[2118]: 2024-10-29 21:52:42 ERROR 404: Not Found.
[  300.500385] cloud-init[2118]: --2024-10-29 21:52:42--  https://raw.githubusercontent.com/moby/moby/vlatest/contrib/init/systemd/docker.socket
[  300.520196] cloud-init[2118]: Reusing existing connection to raw.githubusercontent.com:443.
[  300.576193] cloud-init[2118]: HTTP request sent, awaiting response... 404 Not Found
[  300.600016] cloud-init[2118]: 2024-10-29 21:52:42 ERROR 404: Not Found.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max

crazy-max commented Oct 30, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Added extra commit to test type=image,tag=latest in GHA and seems we don't use the actual version neither when downloading systemd units: https://github.com/crazy-max/ghaction-setup-docker/actions/runs/11582762974/job/32246484640?pr=106#step:5:2171

I guess we could use the commit sha from org.opencontainers.image.revision label or annotation: https://github.com/moby/moby/actions/runs/11584834496/job/32252730725#step:3:59

We could also use org.opencontainers.image.source: https://github.com/moby/moby/actions/runs/11584834496/job/32252730725#step:3:60 to make sure of repo origin.

We can look at this as follow-up.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max
crazy-max force-pushed the binimg branch from 58bd305 to 15a8b7d Compare October 30, 2024 06:43
crazy-max
crazy-max previously approved these changes Oct 30, 2024
View reviewed changes
@crazy-max
crazy-max dismissed their stale review October 30, 2024 09:35

ci failure

@crazy-max

crazy-max commented Oct 30, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Does not seem to work on macOS: https://github.com/crazy-max/ghaction-setup-docker/actions/runs/11588305245/job/32265459115?pr=106#step:5:11

image

  Downloading docker cli from dockereng/cli-bin:26.1.5
Error: Cannot find manifest for darwin/amd64/

@vvoland I'm taking a look to switch to undock but if you want to fix this issue, feel free to open a PR on actions-toolkit repo

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vvoland

vvoland commented Oct 30, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

The issue here is that 26.1.5 didn't have the darwin cli builds yet.

27.0.0 was the first version to have the darwin builds in the dockereng/cli-bin:
docker/cli#4996

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vvoland

vvoland commented Oct 30, 2024

Copy link
Copy Markdown
Contributor Author

@crazy-max - Opened a PR to get the git revision from org.opencontainers.image.revision:

docker/actions-toolkit#480

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max

crazy-max commented Oct 30, 2024

Copy link
Copy Markdown
Member

The issue here is that 26.1.5 didn't had the darwin cli builds yet.

Ah right my bad! Let me change the ref here

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@crazy-max
ci: matrix entry for image type
ff9a36b
@crazy-max
crazy-max force-pushed the binimg branch from 15a8b7d to ff9a36b Compare October 30, 2024 10:26
crazy-max
crazy-max approved these changes Oct 30, 2024
View reviewed changes

@crazy-max crazy-max left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok let's get this one in so we can test this workflow on moby using crazy-max/ghaction-setup-docker@master.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@crazy-max
crazy-max merged commit 8321f1d into docker:master Oct 30, 2024
@crazy-max crazy-max added the status/needs-docs-follow-up label Nov 25, 2024
@vvoland vvoland mentioned this pull request Dec 13, 2024
docs: Document version csv format #139
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@crazy-max crazy-max crazy-max approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

status/needs-docs-follow-up

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@vvoland @crazy-max
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.