Giter Site home page Giter Site logo

ansible-docker's Introduction

ansible-docker

Bu repository OBSS DevOps Internship programı için açılmıştır.

Soru-1

Alpine işletim sisteminin üstüne curl ve htop komutları kurulması için Dockerfile yazılır. Bu Dockerfile son sürüm alpine'i çeker ve apt paket yöneticisi ile curl ve htop komutlarını ekler. Bu Dockerfile'ı build ettiğimizde karşımıza bir image gelir. Bu image'i interaktif bir şekilde çalıştırıp alpine sisteminin içine girebliriz.

Dockerfile'ı Build Etme

Bulunduğu dizine build eder ve image oluşturur.
Docker build -t imagename .

İmage Çalıştırma

Image çalıştırılır ve terminalinin içine girilir.
Docker run -it imagename /bin/sh
Alpine'in içinde which curl ve which htop komutlarını çalıştırdığımızda /usr/bin klasörünün altında olduğunu görülür ve execute edilebilir.

Soru-2

Wordpress ve mysql imagelerini çalıştırabileceğimiz bir docker-compose dosyası yazılır. Gerekli çevre değişkenleri atanır ve bağlantılar sağlanır. 80 portunun tuttuğu değer yeni bir port numarasına atanır. Artık bu port numarası sayesinde wordpress sayfası tarayıcıda görüntülenebilir.

Soru-3

Ubuntu 20.04 focal versiyonuna otomatize bir şekilde docker kurmak için playbook dosyası yazılır. Bu dosyanın içinde etkilenecek ip adressleri, tasklerin hangi ayrıcalıkla ve nasıl gerçekleşeceği ile alakalı bilgiler bulunur. Docker'ı indirmek için linkler belirlenir ve son olarak bağımlılıklar yüklenir. Playbook dosyamızı çalıştırmak için içinde etkilenecek ip adreslerini tuttuğumuz bir hosts dosyası bulunur ve burada görevlere göre gerekli başlıklamalar yapılabilir. Bunun haricinde ansible'ın konfigürasyon ayarlarını yapmak için bir ansible.cfg dosyası vardır.

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.