# git clone https://github.com/minzkn/ubuntu.git hwport-ubuntu # cd hwport-ubuntu # git checkout smp86xx-base # ./build-docker-image.sh
export SMP86XX_TOOLCHAIN_PATH="/opt/mips-4.3" export PATH="/opt/mips-4.3/bin:${PATH}"
# docker pull hwport/sigmadesigns:smp86xx smp86xx: Pulling from hwport/sigmadesigns ... Status: Downloaded newer image for hwport/sigmadesigns:smp86xx # docker images REPOSITORY TAG IMAGE ID CREATED SIZE hwport/sigmadesigns smp86xx <image-id> <created-time> <image-size> ...
# docker run -d -h "<container-hostname>" --name "<container-name>" -p <SSH-host-port>:22 [--privileged] [-v "<local-volume-path>:<container-volume-path>"] "hwport/sigmadesigns:smp86xx" ... # docker container ls --all CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES <container-id> hwport/sigmadesigns:smp86xx "/sbin/init" <created-time> <status> 0.0.0.0:<SSH-host-port>->22/tcp <container-name> ...
"<container-hostname>"
: container 내에서의 hostname을 의미합니다.
"<container-name>"
: container 의 이름입니다.
"<SSH-host-port>"
: container 실행 호스트(외부)로의 SSH 접속 포트를 지정합니다.
"--privilieged" 옵션
: container 내에서 권한이 필요한 실행을 해야 하는 경우 필요합니다.
-v "<local-volume-path>:<container-volume-path>"
: container 실행환경의 directory(local-volume-path)를 container 내부의 directory(container-volume-path)에 투영(공유)하고자 하는 경우 사용할 수 있는 옵션입니다.
<container-id>
: container 구동(run)시 자동으로 생성되는 식별자입니다. "<container-name>" 가 지정되지 않아도 이것으로 제어가능합니다.
# docker exec -i -t <container-name> /bin/bash root@<container-hostname>:/# useradd -c "<comment>" -d "/home/<myaccount>" -g users -G users,adm,sudo -m -s /bin/bash <myaccount> root@<container-hostname>:/# passwd <myaccount> Enter new UNIX password: <myaccount's password> Retype new UNIX password: <myaccount's password> passwd: password updated successfully root@<container-hostname>:/# exit
<myaccount>
: container 환경에서 사용하고자 하는 계정이름입니다. SSH 접속시 반드시 필요합니다.
"<comment>"
: 계정에 대한 간단한 설명등을 의미합니다.
<myaccount's password>
: 추가한 사용자 계정의 암호를 입력합니다.
# ssh -o port=<SSH-host-port> <myaccount>@localhost The authenticity of host '[localhost]:<SSH-host-port> ([::1]:<SSH-host-port>)' can't be established. ECDSA key fingerprint is SHA256:<...>. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[localhost]:<SSH-host-port>' (ECDSA) to the list of known hosts. <myaccount>@localhost's password: <myaccount's password> <myaccount>@<container-hostname>:~$ <in-container environment now...>