'프로그램 사용/docker'에 해당되는 글 55건

  1. 2025.09.05 도커 용량 확인
  2. 2024.05.09 docker python cv2.imshow xcb
  3. 2024.05.08 docker permission denied
  4. 2024.05.08 docker start / stop
  5. 2024.05.08 docker attach / detach
  6. 2024.05.08 docker 이미지 이름 주기
  7. 2024.05.08 docker 이미지 만들기
  8. 2024.03.22 도커 cpu 갯수 제한
  9. 2022.10.12 docker snap 버전 문제
  10. 2019.07.15 Dockerfile... 2?

역시 리눅스에서는 df지 ㅋㅋ

docker system df
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          5         4         2.095GB   860MB (41%)
Containers      7         7         9.891MB   0B (0%)
Local Volumes   16        1         1.415GB   1.415GB (99%)
Build Cache     117       0         2.217GB   2.217GB

 

$ docker system df -v
Images space usage:

REPOSITORY          TAG          IMAGE ID       CREATED        SIZE      SHARED SIZE   UNIQUE SIZE   CONTAINERS
redis               7.2-alpine   30db5eb24b65   2 months ago   40.9MB    0B            40.89MB       1
crazymax/msmtpd     latest       a02e73dfcce9   2 months ago   45.3MB    0B            45.3MB        1
librenms/librenms   latest       5c9c20133e5a   2 months ago   823MB     0B            822.5MB       4
mariadb             10           45e2873aa6dc   3 months ago   326MB     0B            326.3MB       1
ubuntu-yocto        18.04        256798aed3a3   2 years ago    860MB     0B            860MB         0

Containers space usage:

CONTAINER ID   IMAGE                      COMMAND                   LOCAL VOLUMES   SIZE      CREATED       STATUS                 NAMES
d8e0e2ea425e   librenms/librenms:latest   "/init"                   0               1.89MB    6 weeks ago   Up 11 days             librenms_snmptrapd
7ef7e23006e5   librenms/librenms:latest   "/init"                   0               2.23MB    6 weeks ago   Up 11 days             librenms_dispatcher
d1072f8b96a0   librenms/librenms:latest   "/init"                   0               2.24MB    6 weeks ago   Up 11 days             librenms_syslogng
9d09733363b0   librenms/librenms:latest   "/init"                   0               3.52MB    6 weeks ago   Up 11 days             librenms
42aa9fd1b7ad   redis:7.2-alpine           "docker-entrypoint.s…"   1               0B        6 weeks ago   Up 11 days             librenms_redis
2bcbceed24e6   mariadb:10                 "docker-entrypoint.s…"   0               2B        6 weeks ago   Up 11 days             librenms_db
adfbf2868639   crazymax/msmtpd:latest     "/init"                   0               8.88kB    6 weeks ago   Up 11 days (healthy)   librenms_msmtpd

Local Volumes space usage:

VOLUME NAME                                                        LINKS     SIZE
cc8bbc92d957d3d57f944b8c9335ceae66274d47443bc3def95cbe4d2fa71eaa   0         28.49kB
fdb3c503b6ba2bcc43c669a05c62757ab2a05f21e8d82b949bf373a485cc26ec   0         634B
10330233a0ffa524dbb796f38fa425babee4da68d7956823755d866e7862689e   0         0B
5f53756da7a5f74159085cce8c2064c4a580430e7d5f1d0ad0c984bc833b3fd0   0         0B
63907623d8e974a080c51368a0a69849c0ef12e3debd675aa26b9ec336ce8db8   0         0B
8596273ad27681d4bd30b99d501f826eced33214bf750acbe41c290c523d3679   0         185MB
a9a08abd2151855e4b9a2c2cbe8f602155f7a77c5abbd2a8fb9f28c4dc733d5b   0         0B
587ad9a2fd73efbca8acc0b6ea95c27a912681a38ae064292313175717707092   0         473.8MB
6ac6d59558c6f8cdfa522cc17a71a2c78cf8796e54159770de3ff5639df3f047   0         0B
cef5678a19a7689e437dad39dc380a2d7f043489bff237e53bf45d2725ccd82f   0         31.81kB
d00f70b5c8f2b478aaa5bed411fc09870e898930ea0f8714f1b59a9dd9548641   0         0B
d159dfbdf8c0be5e63e758f2ee768fe6f7326e8189c855d2391b233c1cd4eae2   1         1.339kB
d95262eaaa7c0619409e4463e8eec80d3742c354c6c6420a22db3bb3b0e29a71   0         0B
5808043847b5d2e22e62b237871066bd00576961f97606ae431c8a7c7d41efd7   0         185MB
95ee82cb19c4a8f7f025adc21732040d5063c478c066e867514bcd020e7a9e1b   0         571MB
e6469f9cf8dfa865cfe501506f53afc9aba496f642cec6ce0fbc46b463446914   0         100.7kB

Build cache usage: 2.217GB

CACHE ID       CACHE TYPE     SIZE      CREATED         LAST USED       USAGE     SHARED
jny7mzu6qu0m   source.local   697B      2 years ago     2 years ago     1         false
x5k09vfgk7ju   regular        61.6MB    2 years ago     2 years ago     1         true
ibs6zjbxc3q0   regular        643MB     2 years ago     2 years ago     1         true
iicxqh6xb5sy   regular        86.8MB    2 years ago     2 years ago     1         true
kjoktyd393ii   regular        2.59MB    2 years ago     2 years ago     1         true
wqdj0n5mv0fk   regular        0B        2 years ago     2 years ago     1         true
makdxsbr6t6r   regular        0B        2 years ago     2 years ago     1         true
3zyn0d7tc8bo   regular        0B        2 years ago     2 years ago     1         true
krrflnbuj7bx   regular        2.7MB     2 years ago     2 years ago     1         true
rprvxuuqj4x5   source.local   0B        2 years ago     2 years ago     1         false
q3mtqpya9puq   regular        0B        17 months ago   17 months ago   1         false
ieb4ii6qj56d   regular        0B        17 months ago   17 months ago   1         false
n1nv2hgg3qn2   regular        0B        17 months ago   17 months ago   1         false
po4fdhoyrma4   regular        0B        17 months ago   17 months ago   1         false
qsodhpl078hi   regular        0B        17 months ago   17 months ago   1         false
yddu59p2060k   regular        0B        17 months ago   17 months ago   1         false
xfmue99apnb0   regular        0B        17 months ago   17 months ago   1         false
98w3frto5lj3   regular        0B        17 months ago   17 months ago   1         false
4cgtbq9ktkn5   regular        1.85kB    17 months ago   17 months ago   1         false
uf3bqw7uzcu3   regular        0B        17 months ago   17 months ago   1         false
es7oarnujshb   regular        2.22MB    17 months ago   17 months ago   1         false
o78iq4f0x8b3   regular        270MB     17 months ago   17 months ago   1         false
4ureau1w4q3i   regular        0B        17 months ago   17 months ago   1         false
sm8rm03q2wd4   regular        18.1MB    17 months ago   17 months ago   1         false
po6wdjsp4rk5   regular        16.6MB    17 months ago   17 months ago   1         false
e8902t2k3dpp   regular        0B        16 months ago   16 months ago   1         false
r0afbomy12b0   regular        0B        16 months ago   16 months ago   1         false
2ghi4w004axo   regular        0B        16 months ago   16 months ago   1         false
s95ux9z8qo5m   regular        0B        16 months ago   16 months ago   1         false
nge3xuf6jxgs   regular        0B        16 months ago   16 months ago   1         false
nmykxrk9bcis   regular        0B        16 months ago   16 months ago   1         false
s0u8vs2czcbf   regular        0B        16 months ago   16 months ago   1         false
9pmgbk164n85   regular        0B        16 months ago   16 months ago   1         false
inyi8ai3ds3e   regular        21.8kB    16 months ago   16 months ago   1         false
lrpj2oyjleh2   regular        19.4MB    16 months ago   16 months ago   1         false
nikdc12sinaa   regular        1.78kB    16 months ago   16 months ago   1         false
obls139l3vh6   regular        7.5kB     16 months ago   16 months ago   1         false
qj1c24zyrvob   regular        345MB     16 months ago   16 months ago   1         false
m7nxc34d51bd   source.local   359B      17 months ago   16 months ago   4         false
85a8xi7hujns   source.local   0B        17 months ago   16 months ago   3         false
2xjxqusnw20l   regular        19.4MB    16 months ago   16 months ago   1         false
qqqubndviq52   regular        345MB     16 months ago   16 months ago   1         false
5ovtdes06k03   regular        0B        16 months ago   16 months ago   2         false
cn3apkzlpcrz   regular        21.8kB    16 months ago   16 months ago   1         false
vug5rdehq38c   regular        7.24kB    16 months ago   16 months ago   1         false
sxs01eodwzbe   regular        1.78kB    16 months ago   16 months ago   1         false
5uf16uaftq1x   regular        0B        14 months ago   14 months ago   1         false
kspm11lx2pyi   regular        0B        14 months ago   14 months ago   1         false
n97lcjctcxzy   regular        0B        14 months ago   14 months ago   1         false
mdsw3ondqhvr   regular        1.78kB    14 months ago   14 months ago   1         false
xqbkqhn1y9yn   regular        0B        14 months ago   14 months ago   1         false
rr0mzscsatuu   regular        19.4MB    14 months ago   14 months ago   1         false
hcvlg12hogvo   regular        21.8kB    14 months ago   14 months ago   1         false
93tuatu25yvf   regular        7.5kB     14 months ago   14 months ago   1         false
8o9nn8r2eaho   regular        355MB     14 months ago   14 months ago   1         false
hb9k9w985nd4   regular        0B        14 months ago   14 months ago   2         false
q8a6ocz84nbl   regular        0B        14 months ago   14 months ago   2         false
z775g7uinj64   regular        0B        14 months ago   14 months ago   2         false
i991l08j0mh5   regular        0B        14 months ago   14 months ago   2         false
yt6in5ok59cn   regular        0B        14 months ago   14 months ago   2         false
2vuzz6rrs9xw   regular        0B        14 months ago   14 months ago   1         false
kat7vis3d527   regular        0B        14 months ago   14 months ago   1         false
2k3hjerabalv   regular        51MB      14 months ago   14 months ago   1         false
idwhasw5mvfx   regular        1.78kB    14 months ago   14 months ago   1         false
z6mhyvgrls89   regular        0B        14 months ago   14 months ago   1         false
i7tlj9v0yzzq   regular        1.68kB    14 months ago   14 months ago   1         false
innbsda6beuh   regular        0B        14 months ago   14 months ago   1         false
dhu79uiha3qo   regular        19.4MB    14 months ago   14 months ago   1         false
hx86hi4cpn8o   regular        19.4MB    14 months ago   14 months ago   1         false
8wv281gr7fcx   regular        7.5kB     14 months ago   14 months ago   1         false
mfuu9l6ej47f   regular        22.8MB    14 months ago   14 months ago   1         false
ampzlwjgnqn9   regular        355MB     14 months ago   14 months ago   1         false
r5p548010wuc   regular        1.78kB    14 months ago   14 months ago   1         false
v44xkgdt0c8n   regular        0B        13 months ago   13 months ago   1         false
wnokhonmjhlp   regular        0B        13 months ago   13 months ago   1         false
a5yx08sc0ygx   regular        0B        13 months ago   13 months ago   1         false
n7agl1kq5ifh   regular        0B        13 months ago   13 months ago   1         false
35uebbj81utp   regular        0B        13 months ago   13 months ago   1         false
ja7jc9hqs38h   regular        0B        13 months ago   13 months ago   1         false
juwn10f1dml5   regular        0B        13 months ago   13 months ago   1         false
uomlhn7s2fpb   regular        841B      13 months ago   13 months ago   1         false
d7blluzmoips   regular        58.6MB    13 months ago   13 months ago   1         false
1f6jecen58es   regular        991B      13 months ago   13 months ago   1         false
p4ryxiank4oq   source.local   150B      14 months ago   13 months ago   4         false
yylffm7wgiw1   source.local   0B        14 months ago   13 months ago   4         false
vbgcm1qoqhqu   regular        0B        13 months ago   13 months ago   1         false
qwhulnag5n17   source.local   991B      13 months ago   13 months ago   1         false
i1ho0tutoew0   regular        0B        13 months ago   13 months ago   1         false
wasw558snz2e   regular        0B        13 months ago   13 months ago   1         false
jziyntdfnctj   regular        0B        13 months ago   13 months ago   1         false
cmq0y59w1hi0   regular        0B        13 months ago   13 months ago   1         false
yi9solt1yii8   regular        0B        13 months ago   13 months ago   1         false
9j68dcxsbzl7   regular        0B        13 months ago   13 months ago   1         false
um79teqphg8w   regular        0B        13 months ago   13 months ago   1         false
prej9z8swg44   regular        0B        13 months ago   13 months ago   1         false
l0fxuiq5mz5x   source.local   991B      13 months ago   13 months ago   1         false
p457ilq4onkn   regular        0B        13 months ago   13 months ago   1         false
mfuuhrl4h923   regular        841B      13 months ago   13 months ago   1         false
uoe0j62w2e6l   regular        58.6MB    13 months ago   13 months ago   1         false
w9ocavcy7mat   regular        991B      13 months ago   13 months ago   1         false
l9ydoonukq2w   source.local   150B      13 months ago   13 months ago   1         false
5glaf3v5jjsg   source.local   0B        13 months ago   13 months ago   1         false
z0ohilrpap0t   regular        0B        13 months ago   13 months ago   1         false
mnz8rux9enp6   regular        19.6MB    8 months ago    8 months ago    1         false
l979qjvevzm6   regular        1.78kB    8 months ago    8 months ago    1         false
yp0tp9w44nkp   regular        54.1MB    8 months ago    8 months ago    1         false
ftekjaxr68b8   regular        1.68kB    8 months ago    8 months ago    1         false
z1z2w8klcpdd   regular        19.6MB    8 months ago    8 months ago    1         false
kfivdpi3xu5e   regular        54.7MB    8 months ago    8 months ago    1         false
glbj6vgbg39h   regular        1.68kB    8 months ago    8 months ago    1         false
1iaxxn9hcgla   regular        1.78kB    8 months ago    8 months ago    1         false
sqilqm25co97   regular        19.6MB    8 months ago    8 months ago    1         false
zihwyokyw2tr   regular        1.68kB    8 months ago    8 months ago    1         false
ujhmzsqumctg   regular        1.78kB    8 months ago    8 months ago    1         false
ffax67h6qbj3   source.local   195B      8 months ago    8 months ago    3         false
d811115ierno   source.local   0B        8 months ago    8 months ago    3         false
xbgo8pyop085   regular        54.7MB    8 months ago    8 months ago    1         false

 

$ docker help system df
Usage:  docker system df [OPTIONS]

Show docker disk usage

Options:
      --format string   Format output using a custom template:
                        'table':            Print output in table format with column headers (default)
                        'table TEMPLATE':   Print output in table format using the given Go template
                        'json':             Print in JSON format
                        'TEMPLATE':         Print output using the given Go template.
                        Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
  -v, --verbose         Show detailed information on space usage

 

$ docker help system
Usage:  docker system COMMAND

Manage Docker

Commands:
  df          Show docker disk usage
  events      Get real time events from the server
  info        Display system-wide information
  prune       Remove unused data

Run 'docker system COMMAND --help' for more information on a command.

 

[링크 : https://soundprovider.tistory.com/entry/Docker-Docker-용량-정리]

'프로그램 사용 > docker' 카테고리의 다른 글

docker python cv2.imshow xcb  (0) 2024.05.09
docker permission denied  (0) 2024.05.08
docker start / stop  (0) 2024.05.08
docker attach / detach  (0) 2024.05.08
docker 이미지 이름 주기  (0) 2024.05.08
Posted by 구차니

글을 찾아보는데 대부분이 Xwin 시절의 내용이라

죄다 X로 돌리는건데.. wayland 쓰는 환경이라 안되서 이래저래 멘붕중

>>> cv2.imshow("tt",img)
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "/usr/local/lib/python3.12/site-packages/cv2/qt/plugins"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

 

 

opencv headless 를 설치하면 된다는데

$ pip install opencv-python-headless

[링크 : https://shuka.tistory.com/62]

 

막상해보면 not implemented 라고 나오면서 실행이 안될뿐이고 (머.. xcb 에러를 안 뱉으니 된다고 해야하나?)

>>> cv2.imshow("tt",img)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cv2.error: OpenCV(4.9.0) /io/opencv/modules/highgui/src/window.cpp:1272: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'

 

 

$ env | grep -i way
XDG_SESSION_TYPE=wayland
XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.V6LHN2
WAYLAND_DISPLAY=wayland-0

$ env | grep -i xdg
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_MENU_PREFIX=gnome-
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=wayland
XDG_CURRENT_DESKTOP=ubuntu:GNOME
XDG_SESSION_CLASS=user
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop

 

docker run -e XDG_RUNTIME_DIR=/tmp \
           -e WAYLAND_DISPLAY=$WAYLAND_DISPLAY \
           -v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY  \
           --user=$(id -u):$(id -g) \
           imagename waylandapplication

[링크 : https://github.com/mviereck/x11docker/wiki/How-to-provide-Wayland-socket-to-docker-container]

'프로그램 사용 > docker' 카테고리의 다른 글

도커 용량 확인  (0) 2025.09.05
docker permission denied  (0) 2024.05.08
docker start / stop  (0) 2024.05.08
docker attach / detach  (0) 2024.05.08
docker 이미지 이름 주기  (0) 2024.05.08
Posted by 구차니

집에서 도커 깔고 해보려는데 안된다?

그런데 한번 포맷을 했었나.. 도커 깔려있는줄 알았는데...

$ docker run -it python
docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

 

아무튼 아래의 두개 명령을 통해 리부팅 없이 사용가능하다.

$ sudo usermod -aG docker $USER
$ newgrp docker

[링크 : https://yoo-young.tistory.com/102]

[링크 : https://wscode.tistory.com/112]

'프로그램 사용 > docker' 카테고리의 다른 글

도커 용량 확인  (0) 2025.09.05
docker python cv2.imshow xcb  (0) 2024.05.09
docker start / stop  (0) 2024.05.08
docker attach / detach  (0) 2024.05.08
docker 이미지 이름 주기  (0) 2024.05.08
Posted by 구차니

docker start

docker stop

docker ps

가 전부

docker container  하위의 명령이고 alias로 지정되어 있었다니.. 그걸 이제 알게 되네 -_-

 

[링크 : https://docs.docker.com/reference/cli/docker/container/stop/]

 

[링크 : https://docs.docker.com/reference/cli/docker/container/start/]

 

docker container ls

alias - docker ps

[링크 : https://docs.docker.com/reference/cli/docker/container/ls/]

'프로그램 사용 > docker' 카테고리의 다른 글

docker python cv2.imshow xcb  (0) 2024.05.09
docker permission denied  (0) 2024.05.08
docker attach / detach  (0) 2024.05.08
docker 이미지 이름 주기  (0) 2024.05.08
docker 이미지 만들기  (0) 2024.05.08
Posted by 구차니

오래되서 예전에 했던것 같은데 기억이 가물가물..

 

docker 에서 떼어내고 싶을때

minicom ctrl - q - a 누르는 느낌이라고 해야하나..

# docker attach 8cb38d0aa991
root@8cb38d0aa991:/# 
root@8cb38d0aa991:/# read escape sequence

ctrl - p - q

 

붙일때는 docker attach

docker attach 8c
root@8cb38d0aa991:/# 

[링크 : https://bio-info.tistory.com/137]

 

정상적인 붙이는 방법인진 모르겠지만

run -i(interactive)로 해도 붙긴한다.

# docker run -i 8c

'프로그램 사용 > docker' 카테고리의 다른 글

docker permission denied  (0) 2024.05.08
docker start / stop  (0) 2024.05.08
docker 이미지 이름 주기  (0) 2024.05.08
docker 이미지 만들기  (0) 2024.05.08
도커 cpu 갯수 제한  (0) 2024.03.22
Posted by 구차니

docker image tag 라는 명령으로 docker image ls 로 출력되는, 저장소와 태그를 지정해 줄 수 있다.

# docker image ls
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
<none>       <none>    2dda03d51aa0   8 seconds ago   1.47GB
python       latest    d3fe50f3ed7f   4 weeks ago     1.02GB

# docker image tag 2dda03d51aa0 test_py:custom

# docker image ls
REPOSITORY   TAG       IMAGE ID       CREATED              SIZE
test_py      custom    2dda03d51aa0   About a minute ago   1.47GB
python       latest    d3fe50f3ed7f   4 weeks ago          1.02GB

 

$ docker image tag REPOSITORY:TAG

[링크 : https://miiingo.tistory.com/332]

[링크 : https://velog.io/@pinion7/도커-이미지-생성해보기-feat.-Dockerfile]

'프로그램 사용 > docker' 카테고리의 다른 글

docker start / stop  (0) 2024.05.08
docker attach / detach  (0) 2024.05.08
docker 이미지 만들기  (0) 2024.05.08
도커 cpu 갯수 제한  (0) 2024.03.22
docker snap 버전 문제  (0) 2022.10.12
Posted by 구차니

FROM은 원하는 기반이 될 이미지

RUN은 이미지를 받고 나서 실행하여 이미지에 추가될 명령어들

$ cat Dockerfile
FROM python

RUN apt-get update
RUN apt-get install -y libgl1-mesa-glx libglib2.0-0
RUN pip install opencv-python

CMD ["bash"]

 

먼가.. 요즘 언어들 빌드하는 느낌?

$ docker build .

[링크 : https://ok-lab.tistory.com/113]

 

Dockerfile 문법이 간단하긴 하긴 그게 배우기 싫어서, 직접 만드는방법은 없나 찾아보는 중

 

컨테이터에서 image로 변환하기

[링크 : https://www.dataset.com/blog/create-docker-image/]

[링크 : https://docs.docker.com/reference/cli/docker/container/create/]

 

 

+

집에서 해보려니 안된다. 버전이 올라가면서 docker build 가 deprecated 된거 같은데..

그걸 떠나서 왜 FROM 이 안 먹지?

$ docker --version
Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1

$ docker build .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  2.048kB
Error response from daemon: dockerfile parse error on line 1: unknown instruction: FROM python/latest

 

리눅스에서 vi로 생성했더니 인코딩 문제가 있는  듯.

vscode로 보니 공백이 이상하게 인식된다.

이상한 공백을 복사해서 진짜 공백으로 치환하니 잘 된다.

'프로그램 사용 > docker' 카테고리의 다른 글

docker attach / detach  (0) 2024.05.08
docker 이미지 이름 주기  (0) 2024.05.08
도커 cpu 갯수 제한  (0) 2024.03.22
docker snap 버전 문제  (0) 2022.10.12
Dockerfile... 2?  (0) 2019.07.15
Posted by 구차니
프로그램 사용/docker2024. 3. 22. 19:02

어떻게 보면 당연한건데 docker 에도 리소스 제한하는게 가능하다.

항상 제한없이 쓰다 보니 별 생각을 못했네..

 

docker run --memory

docker run --cpu-shares 1024 (1 cpu)

docker run --cpuset-cpus 0,2 (affinity)

[링크 : https://devbksheen.tistory.com/m/entry/도커-컨테이너-자원-할당-제한하기]

'프로그램 사용 > docker' 카테고리의 다른 글

docker 이미지 이름 주기  (0) 2024.05.08
docker 이미지 만들기  (0) 2024.05.08
docker snap 버전 문제  (0) 2022.10.12
Dockerfile... 2?  (0) 2019.07.15
docker remote  (0) 2019.07.15
Posted by 구차니
프로그램 사용/docker2022. 10. 12. 11:10

특정 디렉토리 마운트 시 read -only 라고 마운트 안되는 문제 있음

 

[링크 : https://askubuntu.com/questions/907110/]

[링크 : https://stackoverflow.com/questions/45764477/]

'프로그램 사용 > docker' 카테고리의 다른 글

docker 이미지 만들기  (0) 2024.05.08
도커 cpu 갯수 제한  (0) 2024.03.22
Dockerfile... 2?  (0) 2019.07.15
docker remote  (0) 2019.07.15
UTS name space  (0) 2019.07.15
Posted by 구차니
프로그램 사용/docker2019. 7. 15. 15:51

 

Dockerfile

COPY .(host) .(container)

CMD 는 ENTRYPOINT의 일부(둘다 지정시)


CMD
The CMD instruction has three forms:
CMD ["executable","param1","param2"] (exec form, this is the preferred form)
CMD ["param1","param2"] (as default parameters to ENTRYPOINT)
CMD command param1 param2 (shell form) <<<<< SHELL FORM

 


docker run -it ubuntu bash
는 cmd를 엎어 씀
entrypoint는 덮어 쓸수 없음(그렇기에 entry point없이 cmd만으로 된것으로 확인할수 있음)

        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "/bin/bash"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:ae950a0376fe6c4d08fa7ff395f50f4a909e26e9f2d865d8641cda024161c6ee",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },

----

docker run help
      --entrypoint string              Overwrite the default ENTRYPOINT of the image

 


[링크 : https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact]

 

 

복수개의 Run

FROM golang:1.11-alpine AS build

# Install tools required for project
# Run `docker build --no-cache .` to update dependencies
RUN apk add --no-cache git
RUN go get github.com/golang/dep/cmd/dep

# List project dependencies with Gopkg.toml and Gopkg.lock
# These layers are only re-built when Gopkg files are updated
COPY Gopkg.lock Gopkg.toml /go/src/project/
WORKDIR /go/src/project/
# Install library dependencies
RUN dep ensure -vendor-only

# Copy the entire project and build it
# This layer is rebuilt when a file changes in the project directory
COPY . /go/src/project/
RUN go build -o /bin/project

# This results in a single layer image
FROM scratch
COPY --from=build /bin/project /bin/project
ENTRYPOINT ["/bin/project"]
CMD ["--help"]


[링크 : https://docs.docker.com/develop/develop-images/dockerfile_best-practices/]

'프로그램 사용 > docker' 카테고리의 다른 글

도커 cpu 갯수 제한  (0) 2024.03.22
docker snap 버전 문제  (0) 2022.10.12
docker remote  (0) 2019.07.15
UTS name space  (0) 2019.07.15
LXC LXD  (0) 2019.07.15
Posted by 구차니