From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- ...gine%2Freference%2Fcommandline%2Fimport%2Findex.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 devdocs/docker/engine%2Freference%2Fcommandline%2Fimport%2Findex.html (limited to 'devdocs/docker/engine%2Freference%2Fcommandline%2Fimport%2Findex.html') diff --git a/devdocs/docker/engine%2Freference%2Fcommandline%2Fimport%2Findex.html b/devdocs/docker/engine%2Freference%2Fcommandline%2Fimport%2Findex.html new file mode 100644 index 00000000..477eb5c3 --- /dev/null +++ b/devdocs/docker/engine%2Freference%2Fcommandline%2Fimport%2Findex.html @@ -0,0 +1,17 @@ +

docker import


Import the contents from a tarball to create a filesystem image

Usage

$ docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]
+

Refer to the options section for an overview of available OPTIONS for this command.

Description

You can specify a URL or - (dash) to take data directly from STDIN. The URL can point to an archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a filesystem or to an individual file on the Docker host. If you specify an archive, Docker untars it in the container relative to the / (root). If you specify an individual file, you must specify the full path within the host. To import from a remote location, specify a URI that begins with the http:// or https:// protocol.

The --change option applies Dockerfile instructions to the image that is created. Supported Dockerfile instructions: CMD|ENTRYPOINT|ENV|EXPOSE|ONBUILD|USER|VOLUME|WORKDIR

For example uses of this command, refer to the examples section below.

Options

Name, shorthand Default Description
+--change , -c + Apply Dockerfile instruction to the created image
+--message , -m + Set commit message for imported image
--platform Set platform if server is multi-platform capable

Examples

Import from a remote location

This creates a new untagged image.

$ docker import https://example.com/exampleimage.tgz
+

Import from a local file

Import to docker via pipe and STDIN.

$ cat exampleimage.tgz | docker import - exampleimagelocal:new
+

Import with a commit message.

$ cat exampleimage.tgz | docker import --message "New image imported from tarball" - exampleimagelocal:new
+

Import to docker from a local archive.

$ docker import /path/to/exampleimage.tgz
+

Import from a local directory

$ sudo tar -c . | docker import - exampleimagedir
+

Import from a local directory with new configurations

$ sudo tar -c . | docker import --change "ENV DEBUG=true" - exampleimagedir
+

Note the sudo in this example – you must preserve the ownership of the files (especially root ownership) during the archiving with tar. If you are not root (or the sudo command) when you tar, then the ownerships might not get preserved.

+

+ © 2019 Docker, Inc.
Licensed under the Apache License, Version 2.0.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.
Docker, Inc. and other parties may also have trademark rights in other terms used herein.
+ https://docs.docker.com/engine/reference/commandline/import/ +

+
-- cgit v1.2.3