Docker
比起一般的虛擬化,使用 Docker 有許多優勢
$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh
例如:一個映像檔可以包含一個完整的 ubuntu 作業系統環境,裡面僅安裝了使用者需要的其它應用程式。
容器是從映像檔建立的執行實例。它可以被啟動、開始、停止、刪除。每個容器都是相互隔離的平台。
$ docker pull bcbcarl/hollywood
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
isg latest e13fd8a649e8 3 days ago 3.68GB
mcr.microsoft.com/devcontainers/base jammy 46ddc7dc0a15 3 months ago 661MB
fathyb/carbonyl latest 173e471b5251 9 months ago 274MB
bcbcarl/hollywood latest 8a85ac985999 5 years ago 533MB
FROM
FROM <image>
FROM <image>:<tag>
example:
FROM ubuntu
RUN
RUN <command>
RUN ["executable", "<param1>", "<param2>"]
example:
RUN apt update\
&& apt upgrade
ENV
ENV <key> <value>
example