Skip to content

Konubinix/Earthfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

In my personal and professional life, I often have to create build images based on either alpine or debian. The flow is always the same.

  1. start with a base image as small as possible,
  2. install the dependencies,
  3. setup the timezone,
  4. create some groups and a user to be used in the created containers,
  5. put the code in a distroless image,

For instance, this is how I created the image to control some p100 wifi plugs.

VERSION 0.8
IMPORT github.com/Konubinix/Earthfile AS e

p100-venv:
    FROM e+debian-python-user-venv --extra_packages="build-essential python3-dev" --packages="humanize redis"
    GIT CLONE https://github.com/almottier/TapoP100 /app/TapoP100
    WORKDIR /app/TapoP100
    RUN pip install /app/TapoP100
    SAVE ARTIFACT /app/venv

p100-build-distroless:
    FROM e+distroless-python3-debian
    COPY +p100-venv/venv /app/venv
    ARG --required ref
    SAVE IMAGE --push konubinix/p100:$ref konubinix/p100:latest
docker inspect konubinix/p100:latest|jq ".[0].Size/1024/1024"
85.4291124343872

About

Some earthfile helpers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published