Skip to content

dr-js/docker-stash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-stash

i:ci

A collection of strange docker scripts

Docker Image Registry:

Image layer is checked with dive

Require enable Docker experimental:

Require enable Docker BuildKit:

Basically for Linux, run:

cat /etc/docker/daemon.json
echo '{ "experimental": true, "features": { "buildkit": true } }' > sudo tee /etc/docker/daemon.json

build concept

The build has layered setup to add each feature layer on top of prev image layer, and an initial core image.

Each build will assemble a build folder with Dockerfile (the context).

For small file changes, expect only the changed layer and after layer get rebuild, currently all layer will get rebuild in CI due to cache is reset every time.

Most build resource file is cached locally, or in buildx-cache for faster dev rebuild.

Current layer stack:

debian:11-core
└─node
  └─bin-common
    └─bin-sshd
      └─bin-git
        ├─dep-build (big layer with C/C++ compiler tools)
        └─bin-nginx
          └─bin-etc (layer from here & above is light, layer below will add 50MiB+ each)
            ├─go
            └─dep-chrome
              └─dep-font
                ├─node-pptr2206
                └─java
                  ├─ruby
                  └─ruby3

build debian11

First create config file source/debian11/BUILD_REPO.json and source/debian11/BUILD_REPO_GHCR.json.

For this repo it's created with: (check the CI file)

echo '"drjs/debian"' > source/debian11/BUILD_REPO.json
echo '"ghcr.io/dr-js/debian"' > source/debian11/BUILD_REPO_GHCR.json

Then run:

npm run build-debian11

Use build-proxy* for slow fetch, the config can also be added in .npmrc like:

noproxy=127.0.0.1,localhost # exclude localhost
proxy=http://127.0.0.1:1080 # for http
https-proxy=http://127.0.0.1:1080 # for https