Menyimpan Hasil modifikasi Image pada docker

docker Uncategorized

a) create container from ubuntu image and run a bash terminal.

$ docker run -i -t ubuntu:14.04 /bin/bash
b) Inside the terminal install curl

# apt-get update
# apt-get install curl
c) Exit the container terminal

# exit
d) Take a note of your container id by executing following command :

$ docker ps -a
e) save container as new image

$ docker commit <container_id> new_image_name:tag_name(optional)
f) verify that you can see your new image with curl installed.
$ docker images

$ docker run -it new_image_name:tag_name bash
# which curl
/usr/bin/curl

 

 

 

 

 

 

menjalankan docker

 

 

Easy with Docker version 1.10.1, build 9e83765.

First you need to create you own docker network (mynet123)

docker network create --subnet=172.18.0.0/16 mynet123

than simply run the image (I’ll take ubuntu as example)

docker run --net mynet123 --ip 172.18.0.22 -it ubuntu bash

then in ubuntu shell

Leave a Reply

Your email address will not be published. Required fields are marked *