Updated on 2022-03-13 GMT+08:00

Creating an Image

  1. Run the vi Dockerfile command in the project directory to generate and compile the Dockerfile file. The content is as follows:

    FROM euler                            #Specify the renamed base image euler.
    WORKDIR /app                          #Specify the working directory app.
    COPY --chown=1001:1001 out /app/      #Copy the generated program to the /app directory. By default, images are deployed on the management platform as the HwHiAiUser user. Add --chown=1001:1001.
    ENTRYPOINT [./main"]                  #Specify the container boot program.

  2. Run the following command to create an image:

    docker build -t myapp .

  3. Run the following command to export the image:

    docker save myapp -o myapp.tar