Postingan

Menampilkan postingan dengan label Docker

Note install Docker and Docker compose Centos

Purpose: Practice, POC Update to get the latest packages and security  sudo yum update    sudo yum upgrade  sudo reboot Install yum-utils    sudo yum install -y yum-utils Install Repository  sudo yum-config-manager \     --add-repo \     https://download.docker.com/linux/centos/docker-ce.repo Install Docker packages  sudo yum install docker-ce docker-ce-cli containerd.io Start Docker services  sudo systemctl start docker Enable Docker process on boot  sudo systemctl enable docker Testing   sudo docker run hello-world Install Docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose How to use docker compose  https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-o...

Docker commit

Docker commit used to reate a new image from a container’s changes. You need to commit the changes you make to the container and then run it. Try this example: sudo docker pull debian After pull image from docker hub, you can customize to fit your enviroment  in this example is just to try install apache2 sudo docker run debian apt-get update && apt-get install -y apache2 or you can access the bash with command: sudo docker run debian Check container id sudo docker ps -l Enter to the bash terminal sudo docker exec -it <container_id> bash  apt-get update && apt-get install -y apache2 exit bash terminal  exit Commit changes to the container: sudo docker commit <container_id> nasohi/www1 Now the container becomes the image, check with the following command: sudo docker images Then run the container: sudo docker run nasohi/www1 Another way is you can make docker file and use docker build Read also: ...

Basic How to Operate Docker

Seperti yang kita tahu bahwa container lebih ringan daripada virtual machine karena container menggunakan shared kernel dari host, namun untuk operasional sama seperti virtual machine yang bisa di create, start, stop, run, dll. Berikut adalah perintah-perintah dasar container menggunakan docker : Example: Download centos image Image ini yang akan digunakan sebagai blueprint dari container docker pull centos Melihat image yang sudah di download docker images Membuat/menjalankan container docker run -t -d --hostname=centos7-srv1 --name centos7-srv1 centos Masuk ke terminal container docker exec -it centos7-srv1 bash Melihat proses container docker ps -a Start docker docker start container_name Stop container docker stop container_name Delete container docker rm container_name Help man docker

Cara install docker

Sebenarnya install docker cukup mudah melalui apt seperti berikut namun perlu terlebih dahulu mengkonfigurasi repository untuk mendapatkan paket docker terbaru. #apt-get install docker-ce Untuk cara lengkapnya bisa menuju ke website resmi docker berikut  https://docs.docker.com/install/linux/docker-ce/debian/ Untuk tutorial dasar penggunaan docker bisa ke website digital ocean berikut https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-debian-9

Version in “./docker-compose.yml” is unsupported. You might be seeing this error because you're using the wrong Compose file version

Problem: Version in “./docker-compose.yml” is unsupported. You might be seeing this error because you're using the wrong Compose file version Solution: Upgrade docker-compose step1: $which docker-compose /usr/bin/docker-compose step2: $sudo rm /usr/bin/docker-compose step3: curl -L https://github.com/docker/compose/releases/download/1.20.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose step4: chmod +x /usr/bin/docker-compose

Install GNU/Linux Debian di Docker

Gambar
Sebelumnya install Docker di Mac/MS Windows/Linux terlebih dahulu, setelah terinstall dengan baik selanjutnya ikuti langkah-langkah berikut: Perintah docker pull diatas adalah untuk mengambil image debian dari official repository Docker. Setelah berhasil terambil, cek dengan perintah >docker images untuk melihat image-image yang ada di sistem docker. Selanjutnya coba jalankan docker dan masuk ke shell nya Ketikkan perintah exit di shell debian diatas untuk keluar dari shell nya dan sistem container untuk debian akan di stop. Oke sekian dulu untuk cara install, menjalankan, dan stop container Debian di Docker.

Nano Server with Docker

Gambar
Berikut adalah screenshoot ketika saya mencoba nano server di dalam docker

Docker - image operating system “windows” cannot be used on this platform

Problem:  Docker - image operating system “windows” cannot be used on this platform Solution:  Your Docker host is configured to run Linux containers inside of a VM. To run Windows containers, you need to "Switch to Windows containers" in the Docker menu. You need to go to the Taskbar -> right click docker icon -> use option Switch to Windows containers. Reference:   https://docs.docker.com/docker-for-windows /