도커 (2)
윈도우10에서 도커 용량 줄이기

윈도우에서 도커를 사용하다보면 사용하지 않는 이미지가 쌓여서 용량이 무한증식하는 사태가 벌어집니다
범인 : "C:\Users\Public\Documents\Hyper-V\Virtual hard disks\MobyLinuxVM.vhdx"

 

미사용 이미지 삭제

> docker images 
REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE 
ddanzit-api_api                   latest              1287e2e8862d        13 days ago         971MB 
                                          310c3191c7df        4 weeks ago         971MB 
                                          19dc6cd2a496        7 weeks ago         971MB 
shippang-api_shippang_server      latest              662739236085        3 months ago        1.53GB 
nginx_nginx                       latest              0a566ca88abf        3 months ago        23.9MB 

> docker rmi 310c3191c7df 19dc6cd2a496 
Deleted: sha256:310c3191c7df7d7928a40b92e2a98f962df9809d3c39b906e65e437cbad0e81a 
Deleted: sha256:128cb726ac87d5009933122f5ecd0e511c1e5b934b702b42680099ad93913872 
Deleted: sha256:9e053b0161e7c8e11742ed4056ea86ca67e407e54eea99f2385bffe0947232ac 
Deleted: sha256:93ec1b72be89394325b7b3103bc83f518d7224aaa4ad5386502b80986c80de9d 
Deleted: sha256:1e376dd0c9aeac1dc477ff8d3008fc494aaf1b6adc9d93cdbb7009c1ae3b88b0 
Deleted: sha256:3989b9e1791054bc63736b9d9bfc28d6d2332cdb5ace3106922151d8339b8310 
Deleted: sha256:d5d74293cd7816f8cfd3afa4c6be31d499669a85e283b00a0dcb59b3c2c411a5 
Deleted: sha256:ef3846b3cf8da1b7cd385745dcd8645681edf220168d95c98845f8fe79a59361 
Deleted: sha256:dd79b4f4ebb863b50f3204bf55ee9f069ab8eb3641651a5b7e3a72f604baeda8 
Deleted: sha256:19dc6cd2a49616860806ea9e6326ef3e45a238d30180a6658cf2653e12de8763 
Deleted: sha256:f73ba70111aa682b27a3e0771ce78f7766cf39aa8bdb8f4ea37d4b7e38fd34b3 
Deleted: sha256:30381e8fdc78ef0353abb0b24a6b6e7e176ef6606912106ed34434a5c59585e1 
Deleted: sha256:7cfcd9ebff4f7b772a2a0e013850e2aa595e16eb14a151d74cb3887c436ce2a4 
Deleted: sha256:c552b92c65d7ad06b29b4bfc0e6ef2ac3574a94deaeaf00b586000a93e789dab 
Deleted: sha256:676761e5886e28e0be002ece7e7c656c12fec7b4d7b5c9d3d8c843b1fe5d6313 
Deleted: sha256:b92fb12e0167105e63962f35d21dde069b7096f98e4c4d80cd51f1e135f8d9cf 
Deleted: sha256:e86492207dcca0add1fa1821d907cbd126354ce727b7f9c54590cba67ba38233 
Deleted: sha256:70e5ae3507821588585f063f1b96bcce9c1ebe69d53d4777a7180faaf771032f 

> docker images 
REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE 
ddanzit-api_api                   latest              1287e2e8862d        13 days ago         971MB 
shippang-api_shippang_server      latest              662739236085        3 months ago        1.53GB 
nginx_nginx                       latest              0a566ca88abf        3 months ago        23.9MB

도커 중지

는 윈도우에서 잠시 도커를 꺼주세요

 

파일 최적화(cmd/powershell 관리자 권한)

>Optimize-VHD -Path  "C:\Users\Public\Documents\Hyper-V\Virtual hard disks\MobyLinuxVM.vhdx"  -Mode Quick

 가상 디스크 압축
    72%
    [oooooooooooooooooooooooooooooooooooooooooooooooooooo           ]

도커 시작

 

 

'개발 > Linux/Server' 카테고리의 다른 글

윈도우10에서 도커 용량 줄이기  (0) 2019.10.15
nginx 로그 로테이트  (0) 2019.01.11
대용량 더미파일 생성 방법  (0) 2018.12.27
쉘 이용해서 자동 로그인하기  (0) 2014.09.17
vmstat 파일에 쓰기  (0) 2014.08.25
shell 색상 입히기  (0) 2013.11.28
  Comments,   0  Trackbacks
댓글 쓰기
docker-compose up 빌드 오류 발생 시 해결 방법

ERROR: Service 'app' failed to build: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: read udp 10.0.2.15:43602->10.0.2.3:53: i/o timeout

도커에서 기동시 위와 같은 오류가 날 경우 아래와 같이 입력 후 기동을 한다


$ docker-machine restart default
$ eval $(docker-machine env default)


$ docker-compose.exe up
Building app
Step 1/5 : FROM openjdk:10.0.1-jdk
ERROR: Service 'app' failed to build: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: read udp 10.0.2.15:43602->10.0.2.3:53: i/o timeout

$ docker-machine restart default
Restarting "default"...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...
Waiting for SSH to be available...
Detecting the provisioner...
Restarted machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

$ eval $(docker-machine env default)

$ docker-compose.exe up
Building app
Step 1/5 : FROM openjdk:10.0.1-jdk
10.0.1-jdk: Pulling from library/openjdk
e367ac4072dc: Pull complete
9a57779b5dba: Pull complete
7a4c28c5ff25: Pull complete
9a8bf5e9a1f1: Pull complete
0e45f9a301ef: Pull complete
70656c3c9396: Pull complete
e1eb305208da: Pull complete
e022358c7c3e: Pull complete


  Comments,   0  Trackbacks
댓글 쓰기