Code Monkey home page Code Monkey logo

docker's Introduction

Belajar Docker

Docker adalah platform yang dapat digunakan untuk memasukan dan menyatukan berbagai program, software maupun sistem operasi ke dalam suatu wadah yang disebut container. Container tersebut nantinya akan memuat kumpulan image yang berisi data konfigurasi file serta pendukung lainnya.

Docker installation

Pull Image

docker pull <image>
docker pull nginx

Melihat Image yang tersimpan

docker image ls
  • atau
docker images

Remove Image

  • Catatan : Image dapat dihapus bila container telah dihentikan atau dihapus.
docker image rm <image_id>
  • contoh
docker image rm 92511e4h66a3

Running image

docker run --name <nama_containernya_bebas> -p <portnya_bebas>:80 -d <nama_image>
docker run -it <image_id> /bin/bash
  • contoh
docker run --name website -p 8080:80 -d nginx
docker run -it 92511e4h66a3 /bin/bash

Setelah dirunning maka Docker Image berubah menjadi Container

Perubahan ini di ikuti dengan adanya docker Container ID, yang berbeda dengan Image ID.

Melihat container yang sedang berjalan

docker ps

Melihat container yang sedang berjalan maupun yang tidak berjalan

docker ps -a

Stop container

docker stop <container_id>
  • contoh
docker stop 800000e4h66a3

Start container

docker start <container_id>
  • contoh
docker start 800000e4h66a3

Debugging Cotainer melalui Interactive Terminal

docker exec -it <container_id> /bin/bash
  • contoh
docker exec -it 800000e4h66a3 /bin/bash

Melihat logs / riwayat aktivitas pada cotainer

docker logs <cotainer_id>
  • contoh
docker logs 800000e4h66a3

Remove container

docker rm -f <cotainer_id>
  • contoh
docker rm -f 800000e4h66a3

docker's People

Contributors

galanghanaf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.