docker more

Table of Contents

Next: , Up: (dir)   [Contents]

docker more

This manual is for program, version version.


Previous: , Up: Top   [Contents]

1 Introduction

docker

https://docs.docker.com/get-started/
http://www.docker.org.cn/book/docker/what-is-docker-16.html
# install docker
sudo apt-get install docker.io

run docker example

sudo docker run  -it ubuntu:16.04 /bin/bash

add a new user

// add sudo user
apt-get update
apt-get install sudo
adduser user
usermod -aG sudo user
https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart
https://www.pendrivelinux.com/how-to-add-a-user-to-the-sudoers-list/

some application

nginx
https://hub.docker.com/_/nginx/
http://www.runoob.com/linux/nginx-install-setup.html

jenkins
https://hub.docker.com/_/jenkins/
// start
$ sudo docker run --name jenkins -p 8080:8080 -p 50000:50000 -d jenkins
$ sudo docker cp jenkins:/var/jenkins_home/secrets/initialAdminPassword .

Docker tutorial

sudo docker version
https://prakhar.me/docker-curriculum/

ubuntu multi arch

sudo dpkg --add-architecture i386
apt-get update
https://wiki.debian.org/Multiarch/HOWTO

// for ubuntu-12.04
check /etc/dpkg/dpkg.cfg.d/ 's output is "multiarch"

ls /etc/dpkg/dpkg.cfg.d/
multiarch

sudo sh -c "echo ’foreign-architecture i386’ > /etc/dpkg/dpkg.cfg.d/multiarch"

https://askubuntu.com/questions/423083/cant-run-dpkg-add-architecture-i386-on-12-04-64-bit-to-run-eclipse-adt

remove all stopped containers

sudo docker rm $(sudo docker ps -a -q)

Docker restart

$ service docker restart

push

sudo docker images
sudo docker commit -m "android build env" d9e9660a9ef5 ft2team/ubuntu-14.04-dev

sudo docker push ft2team/ubuntu-14.04-dev

sudo docker tag ft2team/ubuntu-14.04-dev:latest ft2team/ubuntu-14.04-dev:android_v1
sudo docker push ft2team/ubuntu-14.04-dev:android_v1

ft2team docker

docker pull ft2team/ubuntu_dev
dockerhub account: ft2team

push to docker hub:
sudo docker tag ubuntu:16.04_arm_study ft2team/ubuntu_dev:16.04_arm_study
sudo docker push ft2team/ubuntu_dev:16.04_arm_study

strip layer
sudo docker export 7e9ced42b149 > ubuntu_dev.tar
cat ubuntu_dev.tar | sudo docker import - ft2team/ubuntu_dev:test1
sudo docker tag ft2team/ubuntu_dev:test1 ft2team/ubuntu_dev:latest
sudo docker push ft2team/ubuntu_dev:latest

docker ubuntu-16.04
sudo docker load -i 16.04_ubuntu
sudo docker run -it ubuntu:16.04_ubuntu
su - user // password: 123

run ubuntu-14.04

sudo docker run -v /home/zzy/work:/home/user/code -it ft2team/ubuntu-14.04-dev  su - user

Document

https://docs.docker.com/reference/
https://docs.docker.com/release-notes/  -> docker release
https://www.flockport.com/lxc-vs-docker/#rd?sukey=014c68f407f2d3e1c33f9b5f88da94f1900605cde16cd070ce1cba433724f98688003e1e13e19fb9a45282998ea16795
https://www.flockport.com/