This topic describes the Dockerfile commands supported by Image Builder.
The commands supported by Image Builder are compatible with some Dockerfile commands.
If you are familiar with Dockerfile commands, you can quickly get started with Image
Builder. If you are not familiar with Dockerfile commands, you can learn about the
commands supported by Image Builder from this topic. For more information about Dockerfile
commands, such as the difference between CMD
and ENTRYPOINT
commands, visit Dockerfile reference.
The following table describes the commands supported by Image Builder.
Command | Format or example | Description |
---|---|---|
FROM |
|
Specifies the source image. The command is not supported by image components. After
you configure a source image in an image template, the system generates a FROM command.
Note If you manually configure a
FROM command in an image template, the FROM command overwrites the command generated by the system after you configure a source
image.
|
COMPONENT | COMPONENT ic-bp18hy47cqavewsb**** |
Specifies the image components. You can specify system components or custom components. The command is applicable only to image templates. When you create an image template, you can run the command to specify one or more image components to define the image template in a quick manner. |
RESTART | RESTART |
Restarts the instance. Do not add content to the command. |
RUN |
|
Builds an image. The command can be separated into multiple lines. A line break (\) must be added to the end of each line except the last line. |
ENV |
|
Configures system variables. The command is in the form of a key-value pair.
Note Double quotation marks (") must be included in the following command format:
ENV key1="value1" key2="value2" .
|
WORKDIR |
|
Configures working directories. |
COPY |
|
Copies files. |
USER | USER <username> |
Configures users who execute commands.
Note The
<username> variable must be set to an existing username in the system. Otherwise, an error is
reported when the command is run.
|
LABEL |
|
Defines template metadata. The command can be separated into multiple lines. A line break (\) must be added to the end of each line except the last line. |
CMD |
|
Runs on instance startup. |
ENTRYPOINT |
|
Runs on instance startup. |