Docker Container

NVIDIA UFM-SDN Appliance Command Reference Guide v4.10.0

docker
no docker

Enables dockers then enters docker configuration context.
The no form of the command disables dockers, removes configuration, and deletes all containers and docker images.

Syntax Description

N/A

Default

N/A

Configuration Mode

config

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config) # docker ufm [ mgmt-sa ] (config docker) #

Related Commands

Notes

commit <container-name> <image-name> <image-version>

Creates a new image from a running container.

Syntax Description

container-name

Name of the running container to commit (limited to 180 characters)

image-name

Name of the new image to be created

image-version

Version of the new image to be created

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # commit mycontainer test latest

Related Commands

docker

Notes

remove image <image-name> <image-version>

Removes an image from the Linux docker service.

Syntax Description

image-name

Name of the new image to be deleted

image-version

Version of the new image to be deleted

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # remove image test latest

Related Commands

docker

Notes

exec <container-name> <program-executable>

Executes a program within a running container.

Syntax Description

container-name

Name of the running container to commit (limited to 180 characters)

program-executable

Linux command

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # exec mycontainer "ls -la"

Related Commands

docker

Notes

file fetch <url>

Download a docker file from a remote host or a USB device.

Syntax Description

url

FTP, TFTP, SCP and SFTP are supported (e.g. scp://username[:password]@hostname-or-ip/path/filename)

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # file fetch scp://root:*******@ufm/tmp/test.txt telemetry.1.config

Related Commands

docker

Notes

image upload <filename> <upload_url>

Uploads an image file to a remote host.

Syntax Description

filename

Name of file

upload_url

FTP, TFTP, SCP and SFTP are supported (e.g. scp://username[:password]@hostname-or-ip/path/filename)

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # image upload centos.img.gz scp://username:password@10.10.10.10/var/www/html/<image_name>

Related Commands

docker

Notes

file image upload <filename> <upload_url>

Uploads a file to a remote host.

Syntax Description

filename

Name of file

upload_url

FTP, TFTP, SCP and SFTP are supported (e.g. scp://username[:password]@hostname-or-ip/path/filename)

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # file image upload centos.img.gz scp://username:password@10.10.10.10/var/www/html/<image_name>

Related Commands

docker

Notes

label <label-name>
no label <label-name>

Creates a label which can be used as a shared storage between containers.
The no form of the command removes the label.

Syntax Description

label-name

Name of label

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # label new_label

Related Commands

docker

Notes

label-fetch <url>

Downloads label output files from a remote host or USB device.

Syntax Description

url

FTP, TFTP, SCP and SFTP are supported (e.g. scp://username[:password]@hostname-or-ip/path/filename)

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # label-fetch scp://root:******@r-ufm208/tmp/telemetry.1.config.zip telemetry.1.config 100.0% [#############################################################]

Related Commands

docker

Notes

label-upload <url>

Uploads label output files to a remote host or USB device.

Syntax Description

url

FTP, TFTP, SCP and SFTP are supported (e.g. scp://username[:password]@hostname-or-ip/path/filename)

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # label-upload telemetry.1.config scp://root:********@r-ufm208/tmp

Related Commands

docker

Notes

pull <image-name>[:<version>]

Pulls a docker image from a docker repository.

Syntax Description

image-name

Image name
Format: Name:Version
If only “Name” is provided, “version” defaults to latest

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # pull test Using default tag: latest latest: Pulling from library/test 45a2e645736c: Pull complete Digest: sha256:c577af3197aacedf79c5a204cd7f493c8e07ffbce7f88f7600bf19c688c38799 Status: Downloaded newer image for test:latest

Related Commands

docker

Notes

save <image-name> <image-version> <filename>

Saves an image to a TAR archive.

Syntax Description

image-name

Name of image

image-version

Version of image

filename

Name of file in which to save image

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # save busybox latest my_image Saving and compressing image: busybox version: latest this could take a while...

Related Commands

docker
docker load

Notes

After the file is created, the filename gets appended a *.gz suffix.

shutdown
no shutdown

Stops all docker containers, and deletes all non-auto containers.
The no form of the command enables the docker Linux service and runs all configured auto-start containers.

Syntax Description

N/A

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # no shutdown

Related Commands

docker

Notes

After the file is created, the filename gets appended a *.gz suffix.

start <image-name> <image-version> <container-name> <starting-point> [privileged {network | events-forwarder | ufm-licenses}] [cpus <max-cpu-resources>] [memory <max-memory>] [usb-mount] [label <label-name>] [cmd <command>]
no start <container-name>

Starts a new container from an image.
The no form of the command stops a running docker container (and removes the container if it is not persistent).

Syntax Description

image-name

Name of the new image to start

image-version

Version of the image to start

container-name

Name of the running container to commit (limited to 180 characters)

starting-point

  • init – persistent, start the container after boot, when system initialization is done

  • now – start the container now, this is not persistent

  • now-and-init – starts the container now and after boot, when system configuration is done

privileged

  • network – adds network privileges to the container (--privilege flag)

  • events-forwarder – adds required mounts to use events forwarder

  • ufm-licenses – adds required mounts to use license file

cpus

Sets how much of the available CPU resources a container can use (e.g. "cpus 1.5" guarantees at most one and a half of the available CPUs for the container)

memory

Sets the maximum amount of memory the container can use in MB. The minimum amount of memory to configure is 4MB.

usb-mount

Enables USB mount to the docker container

label

Creates one or two labels to use as a shared storage between containers

cmd

Executes specified command inside the docker

Default

N/A

Configuration Mode

config docker

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config docker) # start centos latest test now Starting docker container. Please wait (this can take a minute)... switch (config) # docker start imagename latestver containername init cpus 0.2 memory 25

Related Commands

docker

Notes

Only one of the privileged options (i.e. events-forwarder, ufm-licenses) can be used

show docker containers <container-name>

Displays set parameters on containers already running, and containers planned to run in the future.

Syntax Description

N/A

Default

N/A

Configuration Mode

Any configuration mode

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config) # show docker containers   cont_example: image : busybox version : latest status : running start point : data-path-ready cpu limit : 0.2 memory limit: 10m labels : - privileges : network, sdk usb mount : enabled another_container: image : busybox version : latest status : - start point : init cpu limit : 0.2 memory limit: 10m labels : my_label privileges : network, sdk usb mount : disabled   ufm [ mgmt-sa ] (config) # show docker containers cont_example   cont_example: image : busybox version : latest status : running start point : data-path-ready cpu limit : 0.2 memory limit: 10m labels : - privileges : network, sdk usb mount : enabled

Related Commands

Notes

  • If a container is already started, the status field displays its current status

  • If a container is configured to run on the next boot, the start point field displays when it will start

  • If there is a mismatch between the configuration of a running container and its next-boot configuration, two entries for the container are shown with both of the configurations

show docker images

Display docker images.

Syntax Description

N/A

Default

N/A

Configuration Mode

Any configuration mode

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config) # show docker images ------------------------------------------------------------- Image Version Created Size ------------------------------------------------------------- ubuntu latest Less than a secon 117MB d ago ubuntu-sdk v1 41 seconds ago 215MB

Related Commands

Notes

show docker labels

Displays docker labels.

Syntax Description

N/A

Default

N/A

Configuration Mode

Any configuration mode

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config) # show docker labels Storage label : label_name1 configured containers list : cont_name2 active containers list : cont_name1   Storage label : label_name2

Related Commands

Notes

show docker ps

Display docker containers.

Syntax Description

N/A

Default

N/A

Configuration Mode

Any configuration mode

History

4.3.0

Example

Copy
Copied!
            

ufm [ mgmt-sa ] (config) # show docker ps --------------------------------------------------------------------------------- Container Image:Version Created Status --------------------------------------------------------------------------------- my_ubuntu_app ubuntu:latest 56 seconds ago Up 50 seconds

Related Commands

Notes

© Copyright 2023, NVIDIA. Last updated on Sep 6, 2023.