Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packer, Dockramp vs Dockerfile

Can someone please explain the advantages/disadvantages using the following when building container images, rather than using the dockerfile.

  1. Packer - tool for creating machine and container images for multiple platforms from a single source configuration

  2. Dockramp - A Client-driven Docker Container Image Builder

like image 849
Tharanga Abeyseela Avatar asked Aug 03 '15 01:08

Tharanga Abeyseela


People also ask

What is the difference between Docker and Packer?

Docker is a system for building, distributing and running OCI images as containers. Containers can be run on Linux and Windows. Packer is an automated build system to manage the creation of images for containers and virtual machines. It outputs an image that you can then take and run on the platform you require.

Does Packer use Docker?

The docker Packer builder builds Docker images using Docker. The builder starts a Docker container, runs provisioners within this container, then exports the container for reuse or commits the image. Packer builds Docker containers without the use of Dockerfiles.

Should you use the same Dockerfile for Dev staging and production builds?

🐳 Use the same Dockerfile for both local development and production with multi-stage builds. If you haven't read my previous post on how to use Docker for local development. I highly recommend you read it before this.


1 Answers

  1. Packer is a tool that initially was created to create AWS AMIs or base VM images in AWS. It has been extended to be used with containers, a lot of different Virtualization software such as VMware, KVM/QEMU, and other cloud/IaaS providers like DigitalOcean. It was developed by Hashicorp but it's open source.

  2. Dockramp is an alternative to using docker build it uses the same Dockerfile that docker build would use but with some additional enhancements. For example, it can use accept heredocs in the RUN command for multiple line bash commands.

Docker/LXC is fairly fast but the main advantage of building images (and this applies to Virtualization images too) is that you can have a fully installed application or application stack from the get-go. This tends to work better in autoscaling environments because it takes less time for your application to start servicing traffic either in a container or VM.

When you are creating your docker image all the time with your Dockerfile it needs to run a series of steps before becoming 'ready', hence it might take longer to start servicing traffic.

Hope it helps.

like image 169
Rico Avatar answered Sep 19 '22 04:09

Rico