diff --git a/lib/cli.js b/lib/cli.js index 5615454..efe2070 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -568,9 +568,10 @@ CLI.prototype.do_sources = function do_sources(subcmd, opts, args, cb) { + '#\n' + '# URL TYPE [OPTIONS]\n' + '#\n' - + '# where "TYPE" is one of "imgapi" (the default) or "docker";\n' - + '# and where "OPTIONS" is the literal string "insecure" to\n' - + '# skip TLS server certificate checking for this source.\n' + + '# where "TYPE" is one of "imgapi" (the default),\n' + + '# "docker" (deprecated), or "dsapi" (deprecated); and where\n' + + '# "OPTIONS" is the literal string "insecure" to skip TLS \n' + + '# server certificate checking for this source.\n' + '#\n' + '# Comments beginning with "#" are stripped.\n' + '#\n'; @@ -739,8 +740,8 @@ CLI.prototype.do_sources.help = ( /* BEGIN JSSTYLED */ 'List and edit image sources.\n' + '\n' - + 'An image source is a URL to a server implementing the IMGAPI, or\n' - + 'the Docker Registry API. The default IMGAPI is ' + common.DEFAULT_SOURCE.url + '\n' + + 'An image source is a URL to a server implementing the IMGAPI\n' + + 'The default IMGAPI is ' + common.DEFAULT_SOURCE.url + '\n' + '\n' + 'Usage:\n' + ' {{name}} sources [--verbose|-v] [--json|-j] # list sources\n' @@ -752,10 +753,8 @@ CLI.prototype.do_sources.help = ( + '{{options}}' + '\n' + 'Examples:\n' - + ' # Joyent\'s primary public image repository (defaults to "imgapi")\n' + + ' # SmartOS primary public image repository (defaults to "imgapi")\n' + ' {{name}} sources -a https://images.smartos.org\n' - + ' # Docker Hub\n' - + ' {{name}} sources -a https://docker.io -t docker\n' /* END JSSTYLED */ ); CLI.prototype.do_sources.options = [ @@ -786,6 +785,7 @@ CLI.prototype.do_sources.options = [ { names: ['add-docker-hub'], type: 'bool', + hidden: true, help: 'A shortcut for "imgadm sources -t docker -a https://docker.io".' }, { @@ -813,7 +813,7 @@ CLI.prototype.do_sources.options = [ default: 'imgapi', helpArg: '', help: 'The source type for an added source. One of "imgapi" (the ' - + 'default) or "docker".' + + 'default) or "docker" (deprecated).' }, { names: ['insecure', 'k'], @@ -1457,12 +1457,11 @@ CLI.prototype.do_import = function do_import(subcmd, opts, args, cb) { CLI.prototype.do_import.help = ( 'Import an image from a source IMGAPI.\n' + '\n' - + 'This finds the image with the given UUID (or repository name and tag,\n' - + 'for Docker sources) in the configured sources and imports it into\n' - + 'the local system.\n' + + 'This finds the image with the given UUID in the configured sources and\n' + + 'imports it into the local system.\n' + '\n' + 'Usage:\n' - + ' {{name}} import \n' + + ' {{name}} import \n' + '\n' + '{{options}}' ); @@ -1647,7 +1646,6 @@ CLI.prototype.do_update = function do_update(subcmd, opts, args, cb) { }; CLI.prototype.do_update.help = ( 'Update currently installed images, if necessary.\n' - + 'This does not yet support images from a "docker" source.\n' + '\n' + 'Images that are installed without "imgadm" (e.g. via "zfs recv")\n' + 'may not have cached image manifest information. Also, images installed\n' diff --git a/lib/imgadm.js b/lib/imgadm.js index 4e9f51b..5eb785b 100644 --- a/lib/imgadm.js +++ b/lib/imgadm.js @@ -20,7 +20,8 @@ * * CDDL HEADER END * - * Copyright 2019 Joyent, Inc. + * Copyright 2020 Joyent, Inc. + * Copyright 2023 MNX Cloud, Inc. * * * * * The main imgadm functionality. The CLI is a light wrapper around this tool. @@ -916,7 +917,7 @@ IMGADM.prototype._loadImages = function _loadImages(callback) { log: self.log, errMsg: 'could not load images', execOpts: { - maxBuffer: 10485760 /* >200k hit in prod, 10M should suffice */ + maxBuffer: 20971520 /* >200k hit in prod, 20M should suffice */ } }, function (zfsErr, stdout, stderr) { if (zfsErr) { diff --git a/man/imgadm.1m.md b/man/imgadm.8.md similarity index 96% rename from man/imgadm.1m.md rename to man/imgadm.8.md index 175e751..4c61f0b 100644 --- a/man/imgadm.1m.md +++ b/man/imgadm.8.md @@ -42,7 +42,6 @@ The manifest is a JSON serialized description. The identifier for an image is its UUID. Most commands operate on images by UUID. - ## OPTIONS **-h**, **--help** @@ -73,8 +72,8 @@ UUID. List and edit image sources. - An image source is a URL to a server implementing the IMGAPI, or - the Docker Registry API. The default IMGAPI is https://images.smartos.org + An image source is a URL to a server implementing the IMGAPI. The + default IMGAPI is https://images.smartos.org Usage: imgadm sources [--verbose|-v] [--json|-j] # list sources @@ -90,15 +89,13 @@ UUID. -a Add a source. It is appended to the list of sources. - --add-docker-hub A shortcut for "imgadm sources -t docker -a - https://docker.io". -d Delete a source. -e Edit sources in an editor. -c, --check Ping check all sources. -t , --type= The source type for an added source. One of - "imgapi" (the default), "docker", or "dsapi" - (deprecated). + "imgapi" (the default), "docker" (deprecated), + or "dsapi" (deprecated). -k, --insecure Allow insecure (no server certificate checking) access to the added HTTPS source URL. -f, --force Force no "ping check" on new source URLs. By @@ -107,12 +104,8 @@ UUID. IMGAPI server. Examples: - # Joyent's primary public image repository (defaults to "imgapi") + # SmartOS primary public image repository (defaults to "imgapi") imgadm sources -a https://images.smartos.org - # Docker Hub - imgadm sources -a https://docker.io -t docker - # Legacy SDC 6.5 DSAPI (deprecated) - imgadm sources -a https://datasets.joyent.com/datasets -t dsapi imgadm avail [] @@ -490,14 +483,8 @@ default there is a 5 minute timeout on state transitions: (VM booted) -> running ## DOCKER INTEGRATION -Since version 3.0.0 imgadm has support for importing Docker images: both in -importing images of `type=docker` from an IMGAPI source and in importing Docker -images directly from Docker Hub. Docker registries other than Docker Hub are -technically supported, but client auth is not yet implemented. - -Add the Docker Hub as an import source with: - - imgadm sources --add-docker-hub +Since version 3.0.0 imgadm has support for importing Docker images in +importing images of `type=docker` from an IMGAPI source. Use the following to mimic `docker images`: