docker extension install: search for the most recent version when a tag is not specified
Update on @benja-M-1 comment:
Some Docker Desktop extensions (e.g. Disk Usage or Logs Explorer) have no a latest tag in Docker Hub, so to install the latest version from the console it is necessary to know it beforehand since a (e.g.) docker extension install docker/logs-explorer-extension -f will fail.
Searching for the most recent version of the extension for the current OS/arch when no tag is specified in the command line and no latest tag exists would resolve this issue.
previous
--- **Tell us about your request** Please, add a "latest" tag to every Docker extension in Docker Hub.Which service(s) is this request for? Docker Desktop
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
Some Docker's Docker Desktop extensions (e.g. Disk Usage or Logs Explorer) have no a latest tag in Docker Hub, so to install the latest version from the console it is necessary to know it beforehand since a (e.g.) docker extension install docker/logs-explorer-extension -f will fail.
Are you currently working around the issue? We're using Ansbile to install Docker Desktop, so we came up with this solution:
- shell: 'docker extension install {{ item }}:{{ version }} -f'
vars:
json: "{{ lookup('url', 'https://hub.docker.com/v2/repositories/{{ item }}/tags') | from_json }}"
version: '{{ json.results[0].name }}'
loop:
- docker/disk-usage-extension
- docker/logs-explorer-extension
become: false
Hi @nuno-andre thanks for the idea!
The pain point here is to know the latest available semver tag of the extension. I wonder if it wouldn't be better for the CLI to retrieve the latest version if none is provided and there is no latest tag.
Hi @benja-M-1!
Yeah, that would be great! Searching for the newest version for an OS/arch in the absence of a latest tag (or a explicit version in the command argument) would be the ultimate solution.
I'm going to update the issue to reflect your approach.