728x90

Linux 쉘 접속

D:\docker>docker ps
CONTAINER ID   IMAGE          COMMAND       CREATED       STATUS          PORTS                                                                 NAMES
7ce950bfb3c5   ubuntu:22.04   "/bin/bash"   4 hours ago   Up 18 minutes   0.0.0.0:1080->80/tcp, 0.0.0.0:1443->443/tcp, 0.0.0.0:1880->8080/tcp   cnssm-ubuntu
 
D:\docker>docker exec -it 7ce950bfb3c5 /bin/bash
root@0:/#

openjdk 17 설치

jdk 설치

root@0:/# apt install openjdk-17-jdk

JAVA_HOME 설정

root@0:/# echo "export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")" | tee /etc/profile.d/java_home.sh
root@0:/# source /etc/profile.d/java_home.sh

java 설치 확인

root@0:/# java --version
openjdk 17.0.13 2024-10-15
OpenJDK Runtime Environment (build 17.0.13+11-Ubuntu-2ubuntu122.04)
OpenJDK 64-Bit Server VM (build 17.0.13+11-Ubuntu-2ubuntu122.04, mixed mode, sharing)
root@0:/# javac --version
javac 17.0.13
root@0:/# echo $JAVA_HOME
/usr/lib/jvm/java-17-openjdk-amd64
root@0:/#

Tomcat 설치

tomcat 계정 생성

root@0:~# useradd tomcat -s /sbin/nologin

Tomcat 다운로드 및 설치

root@0:~# wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.1.34/bin/apache-tomcat-10.1.34.tar.gz
root@0:~# tar xvf apache-tomcat-10.1.34.tar.gz
root@0:~# mv apache-tomcat-10.1.34 /usr/local/

tomcat 사용자 변경

root@0:~# chown tomcat:tomcat -R /usr/local/apache-tomcat-10.1.34/

tomcat 서비스 파일 생성

root@0:~# vi /etc/init.d/tomcat
#!/bin/bash

### BEGIN INIT INFO
# Provides:          tomcat
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start Tomcat at boot time
# Description:       Start Tomcat at boot time
### END INIT INFO

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export CATALINA_HOME=/usr/local/apache-tomcat-10.1.34
export JAVA_OPTS="-Xms250m -Xmx1024m"

RETVAL=$?
case $1 in
start)
    if [ -f $CATALINA_HOME/bin/startup.sh ];
    then
        echo $"Starting Tomcat"
        su -p -s /bin/sh tomcat $CATALINA_HOME/bin/startup.sh
    fi
    ;; 
stop)   
    if [ -f $CATALINA_HOME/bin/shutdown.sh ];
    then
        echo $"Stopping Tomcat"
        su -p -s /bin/sh tomcat $CATALINA_HOME/bin/shutdown.sh
    fi
    ;; 
*)
    echo $"Usage: $0 {start|stop}"
    exit 1
    ;;
esac

exit $RETVAL

서비스 등록

root@0:/# chmod +x /etc/init.d/tomcat
root@0:~# update-rc.d -f tomcat defaults
728x90
728x90

출처

컨테이너 commit 전 이미지 목록 확인

D:\docker>docker images
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
ubuntu       22.04     0e5e4a57c249   4 months ago   117MB

컨테이너 중지

D:\docker>docker ps
CONTAINER ID   IMAGE          COMMAND       CREATED       STATUS          PORTS                                                                 NAMES
7ce950bfb3c5   ubuntu:22.04   "/bin/bash"   4 hours ago   Up 30 minutes   0.0.0.0:1080->80/tcp, 0.0.0.0:1443->443/tcp, 0.0.0.0:1880->8080/tcp   cnssm-ubuntu
 
D:\docker>docker stop 7ce950bfb3c5
7ce950bfb3c5

컨테이너 commit

D:\docker>docker commit -p 7ce950bfb3c5 ubuntu-nginx
sha256:f41c3c19a473d68563cbffec77605a85a20b39e8cf3f1a771adbcf6be9c85a75

컨테이너 삭제

D:\docker>docker rm 7ce950bfb3c5
7ce950bfb3c5

컨테이너 commit 후 이미지 목록 확인

D:\docker>docker images
REPOSITORY     TAG       IMAGE ID       CREATED         SIZE
ubuntu-nginx   latest    f41c3c19a473   4 minutes ago   329MB
ubuntu         22.04     0e5e4a57c249   4 months ago    117MB

이미지 복사

D:\docker>docker save -o ubuntu-nginx.tar ubuntu-nginx:latest

이미지 삭제

D:\docker>docker rmi ubuntu-nginx:latest
Untagged: ubuntu-nginx:latest
Deleted: sha256:f41c3c19a473d68563cbffec77605a85a20b39e8cf3f1a771adbcf6be9c85a75
 
D:\docker>docker images
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
ubuntu       22.04     0e5e4a57c249   4 months ago   117MB

이미지 복원

D:\docker>docker load -i ubuntu-nginx.tar
Loaded image: ubuntu-nginx:latest
 
D:\docker>docker images
REPOSITORY     TAG       IMAGE ID       CREATED          SIZE
ubuntu-nginx   latest    f41c3c19a473   12 minutes ago   329MB
ubuntu         22.04     0e5e4a57c249   4 months ago     117MB

컨터이너 생성

D:\docker>docker run -it ^
--hostname 0.0.0.0 ^
--publish 2080:80 --publish 2443:443 --publish 2880:8080 ^
--name bxmas-ubuntu ^
--restart always ^
--volume //d/docker/bxmas/bxmas_home2:/usr/local/bxmas_home ^
ubuntu-nginx:latest ^
/bin/bash

nginx 서비스 시작

root@0:/usr/local/bxmas_home# service nginx start
 * Starting Nginx Server...
728x90
728x90

Ubuntu 도커 이미지 설치

D:\docker>docker run -it ^
--hostname 0.0.0.0 ^
--publish 1080:80 --publish 1443:443 --publish 1880:8080 ^
--name bxmas-ubuntu ^
--restart always ^
--volume //d/docker/bxmas/bxmas_home:/usr/local/bxmas_home ^
ubuntu:22.04 ^
/bin/bash
 
root@0:/#

OS 업데이트

root@0:/# apt update
root@0:/# apt upgrade

Linux 쉘 접속

D:\docker>docker ps
CONTAINER ID   IMAGE          COMMAND       CREATED       STATUS          PORTS                                                                 NAMES
7ce950bfb3c5   ubuntu:22.04   "/bin/bash"   4 hours ago   Up 18 minutes   0.0.0.0:1080->80/tcp, 0.0.0.0:1443->443/tcp, 0.0.0.0:1880->8080/tcp   cnssm-ubuntu
 
D:\docker>docker exec -it 7ce950bfb3c5 /bin/bash
root@0:/#

openjdk 17 설치

jdk 설치

root@0:/# apt install openjdk-17-jdk

JAVA_HOME 설정

root@0:/# echo "export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")" | tee /etc/profile.d/java_home.sh
root@0:/# source /etc/profile.d/java_home.sh

java 설치 확인

root@0:/# java --version
openjdk 17.0.13 2024-10-15
OpenJDK Runtime Environment (build 17.0.13+11-Ubuntu-2ubuntu122.04)
OpenJDK 64-Bit Server VM (build 17.0.13+11-Ubuntu-2ubuntu122.04, mixed mode, sharing)
root@0:/# javac --version
javac 17.0.13
root@0:/# echo $JAVA_HOME
/usr/lib/jvm/java-17-openjdk-amd64
root@0:/#

nginx 설치

nginx 계정 생성

root@0:~# useradd nginx -s /sbin/nologin

nginx 빌드 환경 설정

root@0:~# apt install gcc g++ make perl
root@0:~# mkdir nginx_source
root@0:~# cd nginx_source/
root@0:~/nginx_source# apt install wget
root@0:~/nginx_source# wget https://nginx.org/download/nginx-1.20.1.tar.gz
root@0:~/nginx_source# tar xvf nginx-1.20.1.tar.gz
root@0:~/nginx_source# wget  https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
root@0:~/nginx_source# tar xvf pcre-8.45.tar.gz
root@0:~/nginx_source# wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz
root@0:~/nginx_source# tar -xzvf openssl-1.1.1l.tar.gz
root@0:~/nginx_source# wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz
root@0:~/nginx_source# tar xvf zlib-1.2.11.tar.gz
root@0:~/nginx_source# cd nginx-1.20.1/
root@0:~/nginx_source/nginx-1.20.1#

configure

root@0:~/nginx_source/nginx-1.20.1# ./configure \
--user=nginx \
--group=nginx \
--with-http_sub_module \
--with-zlib=../zlib-1.2.11 \
--with-pcre=../pcre-8.45 \
--with-openssl=../openssl-1.1.1l \
--with-http_ssl_module \
--prefix=/usr/local/nginx \
--conf-path=/usr/local/bxmas_home/nginx_conf/nginx.conf
 
Configuration summary
  + using PCRE library: ../pcre-8.45
  + using OpenSSL library: ../openssl-1.1.1l
  + using zlib library: ../zlib-1.2.11
 
  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/bxmas_home/nginx_conf"
  nginx configuration file: "/usr/local/bxmas_home/nginx_conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

make

root@0:~/nginx_source/nginx-1.20.1# make
 
-lcrypt ../pcre-8.45/.libs/libpcre.a ../openssl-1.1.1l/.openssl/lib/libssl.a ../openssl-1.1.1l/.openssl/lib/libcrypto.a ../zlib-1.2.11/libz.a \
-Wl,-E
sed -e "s|%%PREFIX%%|/usr/local/nginx|" \
        -e "s|%%PID_PATH%%|/usr/local/nginx/logs/nginx.pid|" \
        -e "s|%%CONF_PATH%%|/usr/local/bxmas_home/nginx_conf/nginx.conf|" \
        -e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \
        < man/nginx.8 > objs/nginx.8
make[1]: Leaving directory '/root/nginx_source/nginx-1.20.1'

make install

root@0:~/nginx_source/nginx-1.20.1# make install
make -f objs/Makefile install
make[1]: Entering directory '/root/nginx_source/nginx-1.20.1'
test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'
test -d '/usr/local/nginx/sbin' \
        || mkdir -p '/usr/local/nginx/sbin'
test ! -f '/usr/local/nginx/sbin/nginx' \
        || mv '/usr/local/nginx/sbin/nginx' \
                '/usr/local/nginx/sbin/nginx.old'
cp objs/nginx '/usr/local/nginx/sbin/nginx'
test -d '/usr/local/bxmas_home/nginx_conf' \
        || mkdir -p '/usr/local/bxmas_home/nginx_conf'
cp conf/koi-win '/usr/local/bxmas_home/nginx_conf'
cp conf/koi-utf '/usr/local/bxmas_home/nginx_conf'
cp conf/win-utf '/usr/local/bxmas_home/nginx_conf'
test -f '/usr/local/bxmas_home/nginx_conf/mime.types' \
        || cp conf/mime.types '/usr/local/bxmas_home/nginx_conf'
cp conf/mime.types '/usr/local/bxmas_home/nginx_conf/mime.types.default'
test -f '/usr/local/bxmas_home/nginx_conf/fastcgi_params' \
        || cp conf/fastcgi_params '/usr/local/bxmas_home/nginx_conf'
cp conf/fastcgi_params \
        '/usr/local/bxmas_home/nginx_conf/fastcgi_params.default'
test -f '/usr/local/bxmas_home/nginx_conf/fastcgi.conf' \
        || cp conf/fastcgi.conf '/usr/local/bxmas_home/nginx_conf'
cp conf/fastcgi.conf '/usr/local/bxmas_home/nginx_conf/fastcgi.conf.default'
test -f '/usr/local/bxmas_home/nginx_conf/uwsgi_params' \
        || cp conf/uwsgi_params '/usr/local/bxmas_home/nginx_conf'
cp conf/uwsgi_params \
        '/usr/local/bxmas_home/nginx_conf/uwsgi_params.default'
test -f '/usr/local/bxmas_home/nginx_conf/scgi_params' \
        || cp conf/scgi_params '/usr/local/bxmas_home/nginx_conf'
cp conf/scgi_params \
        '/usr/local/bxmas_home/nginx_conf/scgi_params.default'
test -f '/usr/local/bxmas_home/nginx_conf/nginx.conf' \
        || cp conf/nginx.conf '/usr/local/bxmas_home/nginx_conf/nginx.conf'
cp conf/nginx.conf '/usr/local/bxmas_home/nginx_conf/nginx.conf.default'
test -d '/usr/local/nginx/logs' \
        || mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/logs' \
        || mkdir -p '/usr/local/nginx/logs'
test -d '/usr/local/nginx/html' \
        || cp -R html '/usr/local/nginx'
test -d '/usr/local/nginx/logs' \
        || mkdir -p '/usr/local/nginx/logs'
make[1]: Leaving directory '/root/nginx_source/nginx-1.20.1'

서비스 등록

/etc/init.d/nginx에서 환경파일(nginx.conf) 경로 수정 필요

root@0:~# wget --no-check-certificate https://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx -O /etc/init.d/nginx
root@0:~# chmod +x /etc/init.d/nginx
root@0:~# update-rc.d -f nginx defaults
728x90
728x90

출처

Rocky Linux 이미지 다운로드

D:\docker>docker pull rockylinux:9
9: Pulling from library/rockylinux
446f83f14b23: Pull complete
Digest: sha256:d7be1c094cc5845ee815d4632fe377514ee6ebcf8efaed6892889657e5ddaaa6
Status: Downloaded newer image for rockylinux:9
docker.io/library/rockylinux:9
 
What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview rockylinux:9

Rocky Linux 컨테이너 실행

D:\docker>docker run -it --name rockylinux9_container rockylinux:9 /bin/bash

Docker 컨테이너 목록 확인

D:\docker>docker ps -al
CONTAINER ID   IMAGE          COMMAND       CREATED             STATUS         PORTS     NAMES
0742e89fc2d8   rockylinux:9   "/bin/bash"   About an hour ago   Up 5 seconds             rockylinux9_container

Docker 컨테이너 종료

D:\docker>docker stop rockylinux9_container
rockylinux9_container

Docker 종료된 컨테이너 목록 확인

D:\docker>docker ps -al
CONTAINER ID   IMAGE          COMMAND       CREATED             STATUS                       PORTS     NAMES
0742e89fc2d8   rockylinux:9   "/bin/bash"   About an hour ago   Exited (137) 6 seconds ago             rockylinux9_container

Docker 컨테이너 삭제

D:\docker>docker rm rockylinux9_container
rockylinux9_container

Docker 이미지 목록 확인

D:\docker>docker images
REPOSITORY                 TAG       IMAGE ID       CREATED         SIZE
rockylinux                 9         9cc24f05f309   13 months ago   176MB

Docker 이미지 삭제

D:\docker>docker rmi 9cc24f05f309
Untagged: rockylinux:9
Untagged: rockylinux@sha256:d7be1c094cc5845ee815d4632fe377514ee6ebcf8efaed6892889657e5ddaaa6
Deleted: sha256:9cc24f05f309508aa852967ab1e3b582b302afc92605c24ce27715c683acd805
Deleted: sha256:44343de3ea1d3f71f143967c71a91df76138a17a21ac56642f3c0f2a64b07dce

Rocky Linux 컨테이너 실행

D:\docker>docker run -it ^
--hostname 0.0.0.0 ^
--publish 10022:22 --publish 10080:80 --publish 10443:443 --publish 18080:8080 --publish 18443:8443 ^
--name rockylinux ^
--restart always ^
--volume //d/docker/rockylinux/bluexmas_home:/usr/local/bluexmas_home ^
rockylinux/rockylinux:9.5 ^
/bin/bash
 
Unable to find image 'rockylinux/rockylinux:9.5' locally
9.5: Pulling from rockylinux/rockylinux
3442e16c7069: Pull complete
Digest: sha256:149fd31d916038eb1084d0e051537e279d7afcd5de0b365254e8fa3c3ef12bad
Status: Downloaded newer image for rockylinux/rockylinux:9.5
[root@0 /]#

Rocky Linux /bin/bash 접속

[root@0 /]# exit
exit

D:\docker>docker ps -l
CONTAINER ID   IMAGE                       COMMAND       CREATED          STATUS         PORTS
                                                                                          NAMES
554f3e3a7bd4   rockylinux/rockylinux:9.5   "/bin/bash"   37 seconds ago   Up 6 seconds   0.0.0.0:10022->22/tcp, 0.0.0.0:10080->80/tcp, 0.0.0.0:10443->443/tcp, 0.0.0.0:18080->8080/tcp, 0.0.0.0:18443->8443/tcp   rockylinux

D:\docker>docker exec -it 554f3e3a7bd4 /bin/bash
[root@0 /]#

 

728x90
728x90

출처

도커 이미지 받기

D:\docker> docker pull gitlab/gitlab-ce
Using default tag: latest
latest: Pulling from gitlab/gitlab-ce

Digest: sha256:bef394818ac85471965400e6a86b5c5de3994ba6400f32b20b16eec266c5f3b3
Status: Downloaded newer image for gitlab/gitlab-ce:latest
docker.io/gitlab/gitlab-ce:latest

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview gitlab/gitlab-ce

도커 이미지 목록 조회

D:\docker\gitlab-ce>docker image ls
REPOSITORY                 TAG       IMAGE ID       CREATED        SIZE
gitlab/gitlab-ce           latest    2eac78f2ca26   36 hours ago   3.02GB

컨테이너 생성

D:\docker\gitlab-ce>docker run --detach ^
--hostname 192.168.0.30 ^
--publish 1980:80 --publish 1922:22 --publish 19443:443 ^
--name gitlab-ce ^
--restart always ^
--volume //d/docker/gitlab-ce/config:/etc/gitlab ^
--volume //d/docker/gitlab-ce/logs:/var/log/gitlab ^
--volume //d/docker/gitlab-ce/data:/var/opt/gitlab ^
gitlab/gitlab-ce:latest
d83e65ca9a26822433babb2d08b45eb04b9dbb73413a6c7d7f207dc09f51307b

브라우져 접속 (http://localhost:1980/)

Gitlab root 계정 암호 확인

docker 접속

D:\docker\gitlab-ce>docker exec -it gitlab-ce /bin/bash
root@192:/#

root 계정 암호 확인 (사이트에 접속 해서 암호는 수정할 것 - 까먹지 말자 : Test1234~~)

root@192:/# cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: UvNmajhoONurwfCUJjAT2ShZCY741dzIJJsbuyjO6Fs=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

실행 포트 확인

D:\docker>netstat -nao | findstr 8096
  TCP    0.0.0.0:8096           0.0.0.0:0              LISTENING       12976
  TCP    192.168.0.30:7634      192.168.0.30:8096      ESTABLISHED     19636
  TCP    192.168.0.30:8096      192.168.0.30:7631      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7634      ESTABLISHED     12976
  TCP    192.168.0.30:8096      192.168.0.30:7635      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7638      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7641      TIME_WAIT       0
  TCP    [::]:8096              [::]:0                 LISTENING       12976
  TCP    [::1]:7468             [::1]:8096             ESTABLISHED     19636
  TCP    [::1]:7506             [::1]:8096             ESTABLISHED     19636
  TCP    [::1]:8096             [::]:0                 LISTENING       17952
  TCP    [::1]:8096             [::1]:7468             ESTABLISHED     17952
  TCP    [::1]:8096             [::1]:7506             ESTABLISHED     17952
  TCP    [::1]:8096             [::1]:7603             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7604             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7605             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7606             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7795             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7796             TIME_WAIT       0

실행중인 컨테이너 목록 조회

D:\docker\gitlab-ce>docker ps
CONTAINER ID   IMAGE                     COMMAND             CREATED         STATUS                   PORTS     NAMES
15a159a46350   gitlab/gitlab-ce:latest   "/assets/wrapper"   7 minutes ago   Up 7 minutes (healthy)             gitlab-ce

컨테이너 실행 중지

D:\docker\gitlab-ce>docker stop 15a159a46350
15a159a46350

컨테이너 삭제

D:\docker\gitlab-ce>docker rm 15a159a46350
15a159a46350

로그 확인

D:\docker\gitlab-ce>docker logs -f gitlab-ce
728x90
728x90

출처

도커 이미지 받기

D:\docker>docker pull jellyfin/jellyfin
Using default tag: latest
latest: Pulling from jellyfin/jellyfin
2cc3ae149d28: Pull complete
4f4fb700ef54: Pull complete
c82dc21498d3: Pull complete
1ab9c15f0735: Pull complete                                                                                             ffa18de8d698: Pull complete
84c32e606b27: Pull complete
3f9d9fc1acb5: Pull complete
Digest: sha256:76930362d2c266e8f0b2f51f1c6b039a5207525d0e138a1cdbec870c66c34b0f
Status: Downloaded newer image for jellyfin/jellyfin:latest
docker.io/jellyfin/jellyfin:latest

도커 이미지 목록 조회

D:\docker>docker image ls
REPOSITORY          TAG       IMAGE ID       CREATED       SIZE
jellyfin/jellyfin   latest    49572434ce4c   3 weeks ago   1.04GB

디렉토리 생성

D:\docker>mkdir D:\docker\jellyfin\cache
D:\docker>mkdir D:\docker\jellyfin\config
D:\docker>mkdir D:\docker\jellyfin\media

컨테이너 생성

D:\docker>docker run -d --name jellyfin --publish 8096:8096/tcp --volume //d/docker/jellyfin/config:/config --volume //d/docker/jellyfin/cache:/cache --mount type=bind,source=//d/docker/jellyfin/media,target=/media --restart=unless-stopped jellyfin/jellyfin
95382ea8d758003170012890dda7800cd097e4b5b28fd82cf62ee1ee53cb17e3

실행 확인

실행 포트 확인

D:\docker>netstat -nao | findstr 8096
  TCP    0.0.0.0:8096           0.0.0.0:0              LISTENING       12976
  TCP    192.168.0.30:7634      192.168.0.30:8096      ESTABLISHED     19636
  TCP    192.168.0.30:8096      192.168.0.30:7631      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7634      ESTABLISHED     12976
  TCP    192.168.0.30:8096      192.168.0.30:7635      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7638      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7641      TIME_WAIT       0
  TCP    [::]:8096              [::]:0                 LISTENING       12976
  TCP    [::1]:7468             [::1]:8096             ESTABLISHED     19636
  TCP    [::1]:7506             [::1]:8096             ESTABLISHED     19636
  TCP    [::1]:8096             [::]:0                 LISTENING       17952
  TCP    [::1]:8096             [::1]:7468             ESTABLISHED     17952
  TCP    [::1]:8096             [::1]:7506             ESTABLISHED     17952
  TCP    [::1]:8096             [::1]:7603             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7604             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7605             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7606             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7795             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7796             TIME_WAIT       0

실행중인 컨테이너 목록 조회

D:\docker>docker ps -a
CONTAINER ID   IMAGE               COMMAND                CREATED          STATUS                    PORTS     NAMES
39a869d25a8d   jellyfin/jellyfin   "/jellyfin/jellyfin"   38 seconds ago   Up 38 seconds (healthy)             jellyfin

컨테이너 실행 중지

D:\docker>docker stop 39a869d25a8d
39a869d25a8d

컨테이너 삭제

D:\docker>docker rm 39a869d25a8d
39a869d25a8d
728x90
728x90

출처

도커 허브에 Repository 생성

Docker 허브 로그인

orangepi@orangepi3b:~$ docker login
Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.
You can log in with your password or a Personal Access Token (PAT). Using a limited-scope PAT grants better security and is required for organizations using SSO. Learn more at https://docs.docker.com/go/access-tokens/
 
Username: test@test.com
Password: 
WARNING! Your password will be stored unencrypted in /home/orangepi/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
 
Login Succeeded

Docker 이미지 조회

orangepi@orangepi3b:~$ docker images
REPOSITORY         TAG          IMAGE ID       CREATED          SIZE
oracle/db          19.19-EE     73ebf0277483   7 minutes ago    5.89GB
oraclelinux        8-slim-19c   5ff094295093   17 minutes ago   711MB
custom/mysql       latest       b5783eb91fbe   2 weeks ago      638MB
mysql_container2   latest       09904b463513   2 weeks ago      638MB
arm64v8/mysql      latest       e68e2614955c   2 months ago     638MB

Docker 이미지 태그 지정

실제로는 동일한 이미지 ID를 공유하고 있으며 동일한 이미지를 참조

orangepi@orangepi3b:~$ docker image tag 73ebf0277483 bluexmas/aarch64_oracle_db_19

Docker 이미지 조회

orangepi@orangepi3b:~$ docker images
REPOSITORY                      TAG          IMAGE ID       CREATED          SIZE
bluexmas/aarch64_oracle_db_19   latest       73ebf0277483   8 minutes ago    5.89GB
oracle/db                       19.19-EE     73ebf0277483   8 minutes ago    5.89GB
oraclelinux                     8-slim-19c   5ff094295093   18 minutes ago   711MB
custom/mysql                    latest       b5783eb91fbe   2 weeks ago      638MB
mysql_container2                latest       09904b463513   2 weeks ago      638MB
arm64v8/mysql                   latest       e68e2614955c   2 months ago     638MB

Docker 이미지 도커 허브 저장소에 업로드

orangepi@orangepi3b:~$ docker push bluexmas/aarch64_oracle_db_19
Using default tag: latest
The push refers to repository [docker.io/bluexmas/aarch64_oracle_db_19]
5f70bf18a086: Layer already exists 
a86cfe63678b: Pushed 
b9d8e48a7e13: Pushed 
aa3712efcfb0: Pushed 
49d67b2b3ffc: Pushed 
eb1a67ca2edd: Pushed 
3345ec528d8c: Pushed 
783b508a4793: Pushed 
900d85c165c2: Layer already exists 
efa1a2ef5c15: Layer already exists 
latest: digest: sha256:276c6358c179efab39be868b6a8368df57c29210f0370c2e2cec9017f7b54dc2 size: 2417

 

728x90

+ Recent posts