Create New Container by Building Custom Image
Step 1: Go to Configure > Containers and Container Stacks
Step 2: Build a Container Image with a Custom File
- In theContainers and Container Stacksscreen, click onConfigure Container Images.
- Click onAdd Container Image.
- Assign a name to the image using the format name:tag. If you don't specify a tag, the default tag (latest) will be assigned. The example below uses:nginx
- You can use the Web editor to create a Docker* Compose file or paste Docker* Compose commands. Paste the example Docker* Compose commands below in theWeb Editor.FROM nginx:mainline-alpine RUN curl https://raw.githubusercontent.com/jmandip/nginx-helloworld/main/index.html -o /usr/share/nginx/html/index.htmlIf behind a proxy, add proxy environment information to the Docker* Compose file.
- Click onBuild the image.
- Click onContinue. Once the image is built, it will be listed underContainer Images.
Step 3: Create a Container using the Image Built with the Custom File
- Click onBackand go back to theContainer Imagesscreen underContainers and Container Stacks.
- Click onAdd Container.
- Name the container. Don't use spaces or special characters. In the screen below, it is named:nginx_hello_world_build
- Choose an existing imageis the option selected by default, find and select the image built in the previous step using the search option.
- Click onNext.The next step is defining container settings. All configurations are optional. The instructions below will walk you through defining port configuration for a container onport 8090.
- InPort Configuration, click onPublish a New Manual Network Port.
- InHost Port, enter 8090. InMapped Container Port, enter 80. InProtocol, select TCP.
- Click onNext.You can review configurations and go back to edit details if any modifications are needed.
- Click onDeploy.
- Click onContinue.You should see a message confirming that the container is being deployed, followed by a success or failure message. Once deployment is complete, the container will be started and will show on the Containers list in theContainers and Container Stacksscreen.