Sign inSign up

erichripko/simple-frontend

By erichripko

•Updated 5 months ago

Create simple BuildKit frontends with nearly zero effort

Image
0

1.3K

erichripko/simple-frontend repository overview

This base image is a thin layer on top of a docker/dockerfile frontend⁠. It works by concatenating user-supplied Dockerfile with a pre-configured header and footer. This enables you to create simple frontends with nearly zero effort (and only requires knowledge of Dockerfile syntax). Published from this GitHub repository⁠.

Follow the steps below to create a frontend:

  • Create a Dockerfile for your frontend with the following contents. Note that header and/or footer can be omitted if not needed.
FROM erichripko/simple-frontend
COPY header.Dockerfile footer.Dockerfile /
  • As the name implies, header.Dockerfile is prepended to the file in the user's build context. See below for an example:
FROM ubuntu
  • Similarly, footer.Dockerfile will be appended to the file in the user's build context. See below for an example:
LABEL org.opencontainers.image.licenses="Apache-2.0"
  • Build the frontend: docker build -t ubuntu-dockerfile .
  • Our frontend is now ready to be used. To illustrate this, let's create a sample partial Dockerfile. Note that # syntax= is a special stanza that instructs BuildKit to use a custom frontend. This should match the tag specified by -t earlier.
# syntax=ubuntu-dockerfile
RUN apt-get update && \
    apt-get install -y \
        git \
    && rm -rf /var/lib/apt/lists/*
  • When this Dockerfile is built, our frontend will concatenate it with the header and footer we specified. This will result in the following Dockerfile being used:
FROM ubuntu
RUN apt-get update && \
    apt-get install -y \
        git \
    && rm -rf /var/lib/apt/lists/*
LABEL org.opencontainers.image.licenses="Apache-2.0"

That's it! If you'd like to see a complete ready example, check out examples⁠ directory in the source repository.

Tag summary

Content type

Image

Digest

sha256:ef8d04146…

Size

13.3 MB

Last updated

5 months ago

docker pull erichripko/simple-frontend