"Docker Command"-build command

Source: Internet
Author: User

The Docker build command is used to create a mirror using Dockerfile.

Grammar
Docker build [OPTIONS] PATH | URL | -

Options Description:

  • --build-arg=[]: Sets the variable when the image is created;

  • --cpu-shares: set CPU usage weight;

  • --cpu-period: limit the CPU CFS cycle;

  • --cpu-quota: limit CPU CFS quotas;

  • --cpuset-cpus: Specifies the CPU ID used;

  • --cpuset-mems: Specifies the memory ID used;

  • --disable-content-trust: Ignore the check, the default is turned on;

  • - F: Specifies the dockerfile path to use;

  • --force-rm: Delete Intermediate container during setting mirroring;

  • --isolation: using container isolation technology;

  • --label=[]: Set the metadata used by the image;

  • - m: sets the maximum memory value;

  • --memory-swap: set the maximum swap value is memory +swap, "1" means unlimited swap;

  • --no-cache: The process of creating a mirror does not use caching;

  • --pull: try to update the new version of the image;

  • --quiet,-Q: quiet mode, after successful only output image ID;

  • --rm: After setting the image successfully, delete the intermediate container;

  • --shm-size: Set the size of the/DEV/SHM, the default value is 64M;

  • --ulimit: Ulimit configuration.

  • --tag,-t: the name and label of the image, usually Name:tag or name format; You can set multiple tags for one mirror in a single build.

  • --network: default. Setting the network mode of the Run command during build

Instance

Create the image using the Dockerfile of the current directory, labeled RUNOOB/UBUNTU:V1:

Create the image using the Dockerfile of the URL github.com/creack/docker-firefox :

Docker Build Github.com/creack/docker-firefox

You can also use the location of the-F Dockerfile file:

Docker Build-f/path/to/a/dockerfile.

Before the Docker daemon executes the instructions in Dockerfile, the Dockerfile is first checked for syntax and is returned when there is a syntax error:

Docker build-t Test/myapp.

"Docker Command"-build command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.