Published: 17 Jun 2018 › Updated: 17 Jun 2018
docker commands in mac for beginner
docker commands in mac for beginner
- Install in mac by home brew
> brew install docker
#Install docker
> brew install boot2docker
#Install boot2docker for virtualed docker engine
If your brew have not cask that is extended module
else skip this command.
> brew install caskroom/cask/brew-cask
#Install cask for installing virtual box
> brew cask install virtualbox
#Install virtualbox
- Create docker image
> boot2docker init
#For creating virtualed docker engine
- Start docker
> boot2docker up
#You have to use boot2docker command for starting docker
> export DOCKER_HOST=tcp://192.168.59.103:2375
#You have to register docker host by environment variable, just input command
#It makes docker-client accessible docker-daemon
> boot2docker ssh
#Access docker by ssh
- Commands in docker
> docker version
> docker images
#Check images like ls in terminal
> docker container ls
#Check containers
- Pull image in docker
> docker pull [OS name]:[version]
#Download image from docker.io repository
#Example is > docker pull centos:6.4
- Run image to container in docker
> docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
#Run container.
#Example is docker run -ti --privileged -p 8090:8080
-a , --attach : attach stdin, stdout, stderr (STDIN, STDOUT, STDERR)
--cidfile: output container id by file
-d, --detach: run back ground
-i, --interactive: open container standard input (show situation in container)
-t, --tty: use tty
--name: naming of container
--privileged: connect by privileged mode
-p: forward request to virturalbox port to container inner port
- Remove container/image in docker
> docker rm [container-id]
#Remove container
> docker rmi [image-id]
#Remove image
> docker restart [container-id]
#Restart container
> docker attach [container-id]
#Attach container
- Commit in docker
> docker commit [container_id] [OS name]:[tag]
#Commit in docker
#It saves current container by image
- Exit docker
> exit
#Exit docker
- Stop boot2docker
> boot2docker stop
#Stop boot2docker
Leave docker commands in mac for beginner to:
Read more #docker posts
Best Posts From already
We have not curated any of lineplus's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From already
- Web server and Application server
- docker commands in mac for beginner
- Apply AWS HTTPS(secure http) for EC2
- Why need Annotation in Java?
- What is MVC pattern in JSP?
- What is JVM in JAVA?
- Basic Sorting Algorithms
- Javascript and Node.Js based on Javascript V8 Engine
- Computer Network(Top-down) - Data-Link Layer
- Computer Network(Top-down) - Network Layer
- Computer Network(Top-down) - Transport Layer
- Computer Network(Top-down) - Application Layer
- Computer Network(Top-down) - packet switching and circuit switching
- OS arrangement for test - process & thread
- OS arrangement for test - Cooperating process and Synchronization (2)
- OS arrangement for test - Cooperating process and Synchronization (1)
- OS arrangement for test - scheduling
- OS arrangement for test - process
- OS arrangement for test - 컴퓨터와 OS연계
- OS arrangement for test - 일괄처리 vs 다중처리