Published

Docker İpuçları

Authors
  • avatar
    Name
    xNoJustice

Docker Build

Docker Image Build Etme : docker build .

Docker Image Build'e Isim Verme : docker build . -t (name)

Docker General

Docker Image List : docker images

Docker Container List : docker ps

Docker Container List All : docker ps -a

Docker Pull Image : docker pull (image) (Ornek : docker pull ubuntu)

Docker Run Image : docker run (image) (Ornek : docker run ubuntu)

Docker Ubuntu Bash Erişim : docker run -it ubuntu

**Docker Start/Stop ** docker start (image_name) / docker run --name (name) (image) / docker stop (container_name/container_id)

Docker Ustünde Bir Container'a Dışardan Erişme (Port Ayarlama) : docker run -p Dış_Port:Ic_Port mongo (Örnek : docker run -p 27017:27017 mongo)

Docker Image/Container Silme : docker rm (image/container_name/container_id)

Docker Tüm Container'ları Silme (Aktif Olmayanlar) : docker rm $(docker container ls -aq)

Docker None Images Silme : docker rmi $(docker images -f “dangling=true” -q)

Docker Arka Planda Image Çalıştırma : docker run -d (image_name)

Docker Arka Plandaki Container'ı Aktif Yapma : docker attach (container_name/container_id)

Docker Container Log'a Erişme : docker container logs (container_name/container_id)

Docker'da Volume Oluşturma : docker run -v Bizdeki_klasör:Containerdeki_klasör mongo (Örnek : docker run -v /opt/data:/data/db mongo)

Docker MySQL

Docker MySQL Erişim : docker exec -it _container_name_ bash
MySQL Bash Login : mysql -uroot -ppassword