启动docker镜像
docker run -t -i -d ubuntu:18.04 /bin/bash
配置ustc镜像源
sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list
sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
apt-get clean
apt-get update
apt install software-properties-common
apt install vim xz-utils bzip2 iputils-ping net-tools nginx cmake git
安装成功
apt-get install repo device-tree-compiler git-core u-boot-tools mtools
parted libudev-dev libusb-1.0-0-dev python-linaro-image-tools
autoconf autotools-dev libsigsegv2 m4 intltool libdrm-dev curl sed make binutils
build-essential gcc g++ bash patch gzip gawk bzip2 perl tar cpio python unzip rsync
file bc wget libncurses5 libqt4-dev libglib2.0-dev libgtk2.0-dev libglade2-dev
cvs git mercurial openssh-client subversion asciidoc w3m dblatex graphviz python
libssl-dev expect fakeroot cmake flex bison liblz4-tool libtool
keychain
apt install linaro-image-tools
apt install time
下面这两个暂时安装失败 么有影响
sudo docker commit -m="rk build env add time" -a="simp" b71038100a48 simp/ubuntu:v1_rk1
kdla@kdla-System-Product-Name:~$ sudo docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
simp/ubuntu v2_rk1 c1803dd18786 3 minutes ago 1.79GB
ubuntu latest 6b7dfa7e8fdb 8 hours ago 77.8MB
ubuntu 18.04 251b86c83674 8 hours ago 63.1MB
portainer/portainer latest 5f11582196a4 2 weeks ago 287MB
hello-world latest feb5d9fea6a5 14 months ago 13.3kB
运行后删除容器
sudo docker run -it --rm -v /opt/rk_build1:/opt simp/ubuntu:v2_rk2 /bin/bash
后台运行的容器
sudo docker run -itd --name rk_build1 -v /root/:/home/kdla/rv1126 simp/ubuntu:v2_rk2 /bin/bash
sudo docker run -itd --name rk_build1 -v /home/kdla/rv1126: /root simp/ubuntu:v1_rk1 /bin/bash
后台运行的容器
sudo docker run -itd --name ubuntu1804_simp_media -v /opt/gyz:/home ubuntu:18.04 bash
运行一个 Ubuntu1804的 bash环境 退出后自动删除
docker run -it --rm ubuntu:18.04 bash
查看所有镜像
docker image ls
查看所有镜像体积
docker image df
docker 常用命令
删除镜像 镜像名中带有redis
$ docker image rm $(docker image ls -q redis)
samba
sudo docker run -it -p 139:139 -p 445:445 -d -v /home/kdla:/mount dperson/samba
-u "kdla;kdla"
-u "gyz;gyz"
-s "opt;/mount;yes;no;no;all;kdla;kdla"