M1 docker compose up & docker cp & docker exec
- compose up할
docker-compose.yml
파일 준비
- docker-hadoop-spark
- spark 환경 : jupyterlab, spark-master, spark-worker, mongodb, mysql
- hadoop 환경 : namenode, datanode, resourcemanager, nodemanager, historyserver
1. docker compose up/down
- Create and start containers
- Stop and remove containers, networks
- docker compose up 공식문서
- Run
docker compose up
and the Docker compose command starts and runs your entire app. You can alternatively run docker-compose up
using the docker-compose binary.
Usage
docker compose up [SERVICE...]
docker compose down
Examples
$docker compose up
$docker compose down
2. docker cp
- Copy files/folders between a container and the local filesystem
- docker cp 공식문서
Usage
docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
s
Examples
$docker cp scripts spark-master:/opt/workspace
3. docker exec
Usage
docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
Options
Name, shorthand | Description |
---|
--interactive , -i | Keep STDIN(표준입력) open even if not attached |
--tty , -t | Allocate a pseudo-TTY |
Examples
$docker exec -it spark-master bash
4. docker prune
4.1 Prune images
$docker image prune
4.2 Prune containers
- clean up unused containers
$docker container prune
4.3 Prune volumes
$docker volume prune
4.4 Prune networks
- clean up unused containers
$docker network prune
4.5 Prune everything
- prunes images, containers, and networks. Volumes are not pruned by default, and you must specify the --volumes
$docker system prune
$docker system prune --volumes