Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

563
Visualizações
What is the most light weight base image I can use to build a Dockerfile?

I usually use a Ubuntu or Arch Linux image but I found out recently that there is an OS called CoreOS specifically for docker containers.

As I am new to docker I am not sure which one would be the best base image to build my Dockerfile. It seems like a silly question but in case if I run lots of microservices on several containers, then the container should be as light as possible.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

This really depends on your requirements:

  1. FROM scratch: if you are able to statically compile your application and don't need any other binaries (libraries, shells, or any other command period), then you are use the completely empty "scratch". You'll see this used as the starting point for the other base images, and it's also found in a lot of pre-compiled Go commands.

  2. Busybox: I consider this less of a base image and more of a convenient utility container. You get a lot of common commands in a very small size. However what you don't get is the general package manager to easily install other components. Current size of this is under 1M.

  3. Alpine: This is docker's take on a streamlined image and it does a good job and being small but also giving you a package manager. However that small size comes at a cost, things like glibc are not included. You will find that many of the official images are based on Alpine, so inside of the container ecosystem, this is a very popular option. Current size of this is around 2M before you start adding packages.

  4. Debian, Ubuntu, and CentOS: These are less of the lightweight base images, each coming in around 50M give or take. But what they lose with size they gain with a large collection of packages you can pull from and lots of people that are testing, fixing bugs, and contributing to things upstream. They also come with a collection of libraries that some applications may expect to be preinstalled.

While that last option is a bit larger, keep in mind that base images should only be pushed over the wire and stored on disk once. After that, unless you change them, any images built on top of them only need to send the manifest that references layers in that base image and the docker engine will see that it already has those layers downloaded. And with the union fs, those layers never need to be copied even if you run 100 containers all pointing back to that image, they each use the same read-only layer on disk for all the image layers and write their changes to the their container specific RW layer.

over 4 years ago · Santiago Trujillo Relatório

0

Have a try to alpine linux base image, it's really small(5M) and have has access to a package repository. We're using it to build our JDK base image in our production env and it's running good so far.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda