M1 docker image build & push & pull & commit

ImOk·2022년 3월 7일
0

🐳 Docker

목록 보기
3/5
post-thumbnail

M1 Docker image build & push

  • build할 DockerFile 준비
  • docker-hadoop-spark Dockerfile
  • spark 환경 : jupyterlab, spark-master, spark-worker, mongodb, mysql
  • hadoop 환경 : namenode, datanode, resourcemanager, nodemanager, historyserver

1. docker image build

Usage

docker build [OPTIONS] PATH | URL | -

Options

Name, shorthandDescription
--no-cacheDo not use cache when building the image
--platformSet platform if server is multi-platform capable
--tag , -tName and optionally a tag in the 'name:tag' format
-fSpecify a Dockerfile path inside

Examples

  • Build with PATH
# hadoop-base
$docker build --platform linux/amd64 --no-cache -t imok2/hadoop-base:hadoop3.2.2-java8 ./base
# hadoop-datanode
$docker build --platform linux/amd64 --no-cache -t imok2/hadoop-datanode:hadoop3.2.2-java8 ./datanode
# hadoop-historyserver
$docker build --platform linux/amd64 --no-cache -t imok2/hadoop-historyserver:hadoop3.2.2-java8 ./historyserver
# hadoop-namenode
$docker build --platform linux/amd64 --no-cache -t imok2/hadoop-namenode:hadoop3.2.2-java8 ./namenode
# hadoop-namenode-sqoop
$docker build --platform linux/amd64 --no-cache -t imok2/hadoop-namenode-sqoop:hadoop3.2.2-sqoop1.4.7 ./namenode-sqoop
# hadoop-nodemanager
$docker build --platform linux/amd64 --no-cache -t imok2/hadoop-nodemanager:hadoop3.2.2-java8 ./nodemanager
# hadoop-resourcemanager
$docker build --platform linux/amd64 --no-cache -t imok2/hadoop-resourcemanager:hadoop3.2.2-java8 ./resourcemanager
  • Build Image List

2. docker push

Usage

docker push [OPTIONS] NAME[:TAG]

Examples

  • Push a new image to a registry
$docker login
$docker push imok2/hadoop-base:hadoop3.2.2-java8


3. docker commit

Usage

docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

Examples

$docker commit -m "hadoop-base" hadoop-base imok2/hadoop-base:hadoop3.2.2-java8

4. docker pull

Usage

docker pull [OPTIONS] NAME[:TAG|@DIGEST]

Options

Name, shorthandDescription
--all-tags , -aDownload all tagged images in the repository
--platformSet platform if server is multi-platform capable

Examples

$docker pull debian
profile
ImOk👌

0개의 댓글