$ docker build -t ${imageName} -f ${Dockerfile 위치} ${빌드 실행 위치} --target=${Dockerfile에서 정의한 target} --platform=${빌드할 platform}
: docker image파일 build$ docker build -t image:tag . --target=local --platform=linux/amd64
$ docker push ${imageName}
: docker hub에 docker image 올리기$ docker image prune
, docker container prune
: 필요 없는 도커 이미지나 컨테이너 삭제$ docker ps
: 컨테이너 리스트 출력 -a
: 멈춘 컨테이너도 전부 출력 --no-trunc
: 짤린 글씨를 전부 출력 --format
: 필요한 열만 추출해서 출력docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Command}}"
-s, --size
: 사이즈를 추가 출력ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
저장소 Default 위치: C:\Users\rtm\AppData\Local\Docker\wsl\data
$ wsl -l -v
: WSL 상태 확인
$ wsl -t {실행 중인 wsl 이름}
: 동작 중인 WSL 중지
$ wsl --export docker-desktop-data "D:\Docker\wsl\data\docker-desktop-data.tar"
: Docker data 내보내기
$ wsl --unregister docker-desktop-data
: 현재 Docker data 연결해제
$ wsl --import docker-desktop-data "D:\Docker\wsl\data" "D:\Docker\wsl\data\docker-desktop-data.tar" --version 2
: 해당 위치에 해당 파일로 Docker data 연결
$ sudo mount -t drvfs {마운트 할 드라이브} /mnt/{마운트 할 디렉토리}
: 네트워크 드라이브 마운트
ex) sudo mount -t drvfs Z: /mnt/z
$ sudo echo {마운트 할 드라이브} /mnt/{마운트 할 디렉토리} drvfs defaults,uid=1000,gid=1000 0 0 >> /etc/fstab
: 재부팅 후에도 계속 마운트
# ndc.bat : NDC(Network Drive Connection)
-----------------------------------------------------------------------------------------------------
set delay=5
net use Z: https://mycompany.synology.me:5006/COMMON mypasswd /user:myid /persistent:no
# .wslconfig
[wsl2]
memory=10GB # WSL2 VM에 할당할 메모리
processors=8
swap=4GB # WSL2 VM에 추가할 스왑 공간(스왑 파일 없음의 경우 0)
localhostForwarding=true
$ wsl --shutdown