How to Build Docker Images with Ansible on Ubuntu 20.04

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ก.ย. 2024
  • Building docker images is traditionally completed using a docker file and bash scripts. Today I would like to introduce using configuration management tools to complete this task. Ansible has long been used to build Other types of images and Hosts but has started to get forgotten about in the world of containers. Building an image with Ansible provides numerous benefits compared to the traditional build process.
    Docker documentation:
    docs.docker.co...
    docs.docker.co...
    Github Repo for video:
    github.com/joe...

ความคิดเห็น • 19

  • @alivecoding4995
    @alivecoding4995 ปีที่แล้ว

    Do I understand it correctly that we only used Python and Rsync in order for Ansible to execute the "synchronization steps" and "enable nginx" steps within the docker container? That appears to me to be a significant overhead. Especially, when we always need to install and remove packages just to perform individual operations with ansible for a container.

  • @lakelse2
    @lakelse2 2 ปีที่แล้ว

    Thanks, Joe! I walked through the ansible setup and when I tried to run the container, I was getting 'connection reset' in my browser. I looked in the container and noticed that nginx wasn't running. I commented out 'command: tail -f /dev/null' in the playbook and nginx starts as one would expect. I'm a bit green to this so maybe I'm missing something but thought I'd give you and anyone else a heads up what worked for me. Thanks again!

  • @alivecoding4995
    @alivecoding4995 ปีที่แล้ว

    Does "apt" depend on Python3 to be installed?

  • @geogmz8277
    @geogmz8277 3 ปีที่แล้ว +1

    I'm not sure why your channel does not have more subs.. I watched this video months ago came back to refresh somethings and noticed the subs count.. Your videos are good man makes no sense... But! keep them coming.

  • @matthiasmorath826
    @matthiasmorath826 3 ปีที่แล้ว +2

    A nice option where you also could use your playbook would by to call it in combination with vagrant . Of course without the docker. Commands.

    • @joeterlecki
      @joeterlecki  3 ปีที่แล้ว

      That could be an interesting combination. I might have to try it out. I have used it separately but never with ansible.

  • @MehdiQasimi-b7g
    @MehdiQasimi-b7g ปีที่แล้ว

    Hey Joe
    Thanks for such an informative and supportive video...
    just had a question since u have the website already built-in. what happens with ur this code where there is no website pre-built or in the other ways if there is no website? thanks

  • @FinepixF30
    @FinepixF30 3 ปีที่แล้ว +1

    Great video, exactly what I was looking for.. I suscribed, looking forward for more videos

    • @joeterlecki
      @joeterlecki  3 ปีที่แล้ว

      Thanks. Looking forward to having you as a viewer

  • @rockdarko440
    @rockdarko440 3 ปีที่แล้ว +1

    Hi Joe! Really like the smooth and humble vibes of your videos and obviously the content as well. I would definitely be down for a video where you also include ansible-vault into this formula. I work for the health body of my provincial government (I'm Canadian eh) and we are actually using that formula as it promotes building infrastructure as code - it's a solid formula if you ask me. We are for instance deploying kakfa clusters (that includes a zookeeper cluster) that way. Jenkins/Docker/Ansible is a very powerful workflow combination imo. Cheers from Quebec, Canada. I subbed and hopefully I will get to pick your brain at some point.

    • @joeterlecki
      @joeterlecki  3 ปีที่แล้ว

      Thanks for watching. Sometimes we get caught up in "best practices" for the sake of best practices. I think its a powerful combination too. Yeah you can always use docker files and you should. Sometimes it helps to do something different.

  • @Frogstomp_actual
    @Frogstomp_actual 3 ปีที่แล้ว +1

    Gday Joe, some great ideas there. I love ansible, and see this as a cool way of building custom images with dependancies. Thanks for donating your time making such awesome videos please keep it up. JB, Sydney AU

    • @joeterlecki
      @joeterlecki  3 ปีที่แล้ว

      Thank you for taking the time to view it. I'm glad you lear new something new. Using ansible for dicker might not be the best approach but its nice to have options and go against the status quoa

  • @preetham1986
    @preetham1986 3 ปีที่แล้ว

    @ 7:40 you can just do " docker build . -t " at your pwd.

  • @gzcwnk
    @gzcwnk 3 ปีที่แล้ว

    dont put background music IMHO.

  • @matthiasmorath826
    @matthiasmorath826 3 ปีที่แล้ว +1

    well you made my day...thanx...

    • @joeterlecki
      @joeterlecki  3 ปีที่แล้ว

      You watching and commenting has made my day!!!

  • @preetham1986
    @preetham1986 3 ปีที่แล้ว

    Also never update your images to the latest unless needed. This can cause issues in production. Not a good practice.