tencent cloud

Tencent HealthCare Omics Platform

Product Introduction
Overview
Strengths
Use Cases
Use Limits
Purchase Guide
Billing Overview
Product Pricing
Payment Overdue
Getting Started
Run an Analysis Workflow
Example: Rapid Application Execution in 5 Minutes
Operation Guide
Console
Work Items
File Management
Image Management
Development and Debugging
Permission Management
Resource Monitoring
Practical Tutorial
Visual Running Groups Submission and Management
Rerunning and Continuing Running
API
History
Introduction
API Category
Making API Requests
Environment Management APIs
Tencent Healthcare Omics Platform APIs
Data Types
Error Codes
FAQs
Service Agreement
Related Protocol
PRIVACY POLICY MODULE HEALTHCARE OMICS PLATFORM
DATA PROCESSING AND SECURITY AGREEMENT MODULE HEALTHCARE OMICS PLATFORM
Contact Us

Create Docker Images

PDF
Focus Mode
Font Size
Last updated: 2024-10-22 16:05:05

The Methods for Creating Container Images

There are two main methods for creating a container image:
1. Get the image through a snapshot.
2. Build the image using Dockerfile.
The first method is applicable when subsequent images do not change, and the second one is applicable when subsequent images change frequently.

Method 1: Obtain the image through a snapshot

1. Install the container engine software.
2. Start a blank basic container and enter it.
docker run -it centos
3. Perform the installation tasks:
yum install XXX
git clone https://github.com/lh3/bwa.git
cd bwa;make
4. Exit the container:
exit
5. Make a snapshot:
docker commit -m "xx" -a "test" container-id test/image:tag
6. View the created container image:
docker images

Method 2: Build the image using Dockerfile

Method 2 is applicable to situations where subsequent images are frequently changed. It automates the creation of images by executing the Dockerfile.
For example:
FROM ubuntu:latest

SHELL ["/bin/bash", "-c"]

RUN set -e \\
&& apt-get -y update \\
&& apt-get -y dist-upgrade \\
&& apt-get -y install curl build-essential libncurses5-dev zlib1g-dev libbz2-dev liblzma-dev libcurl4-openssl-dev \\
&& apt-get -y autoremove \\
&& apt-get clean \\
&& rm -rf /var/lib/apt/lists/*
# samtools

RUN set -eo pipefail \\
&& curl -SL \\
https://github.com/samtools/samtools/releases/download/1.15/samtools-1.15.tar.bz2 \\
-o /tmp/samtools.tar.bz2 \\
&& tar xvf /tmp/samtools.tar.bz2 -C /usr/local/src \\
&& mv /usr/local/src/samtools-* /usr/local/src/samtools \\
&& cd /usr/local/src/samtools \\
&& ./configure --prefix=/usr/local \\
&& make \\
&& make install
For more Dockerfile syntax, see Official Dockerfile Documentation.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback