Skip to content

Commit b207824

Browse files
committed
feat(base): use Makefile
1 parent c6eec16 commit b207824

19 files changed

Lines changed: 55 additions & 39 deletions

File tree

.drone/drone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ steps:
1010
- name: publish
1111
commands:
1212
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
13-
- ./build.sh bullseye
13+
- make publish clean
1414
environment:
1515
DEV_REGISTRY:
1616
from_secret: dev_registry
@@ -38,7 +38,7 @@ steps:
3838
- name: publish
3939
commands:
4040
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
41-
- ./build.sh bullseye
41+
- make publish clean
4242
environment:
4343
DEV_REGISTRY:
4444
from_secret: dev_registry

Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
CODENAME ?= bullseye
2+
DEV_REGISTRY ?= docker.io
3+
DRYCC_REGISTRY ?= ${DEV_REGISTRY}
4+
IMAGE = "${DRYCC_REGISTRY}"/drycc/base:"${CODENAME}"-"$(shell dpkg --print-architecture)"
5+
WORK_DIR = /workspace/"${CODENAME}"
6+
7+
SHELLCHECK_PREFIX := docker run --rm -v ${CURDIR}:/workdir -w /workdir ${DRYCC_REGISTRY}/drycc/go-dev shellcheck
8+
SHELL_SCRIPTS = $(shell find . -name '*.sh') $(wildcard debootstrap/*/rootfs/*/bin/*) $(wildcard debootstrap/*/rootfs/*/sbin/*)
9+
10+
SHELL=/bin/bash -o pipefail
11+
12+
clean:
13+
@rm -rf "${WORK_DIR}" "${WORK_DIR}".tar.gz
14+
15+
mkimage:
16+
./scripts/mkimage.sh minbase "${CODENAME}"
17+
18+
build: mkimage
19+
@docker build . \
20+
--tag ${IMAGE} \
21+
--build-arg BASE_LAYER=$(shell docker import ${WORK_DIR}.tar.gz) \
22+
--file Dockerfile
23+
24+
publish: test-style build
25+
@docker push "${IMAGE}"
26+
@echo -e "\\033[32m---> Build image $codename complete, enjoy life...\\033[0m"
27+
28+
test-style:
29+
${SHELLCHECK_PREFIX} $(SHELL_SCRIPTS)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ There isn't a `:latest` tag, because each debian version is a tag.
1919
This base image supports drycc stack installation, its usage is:
2020

2121
```
22-
install-stack postgresql 14.1 /opt/drycc
22+
install-stack postgresql 14.1
2323
```
2424

2525
All stacks currently supported by drycc are in the [stacks](https://github.com/drycc/stacks) project.

build.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

bullseye/rootfs/usr/bin/init-stack

Lines changed: 0 additions & 11 deletions
This file was deleted.
File renamed without changes.

bullseye/rootfs/etc/apt/apt.conf.d/docker-autoremove-suggests renamed to debootstrap/bullseye/rootfs/etc/apt/apt.conf.d/docker-autoremove-suggests

File renamed without changes.
File renamed without changes.

bullseye/rootfs/etc/apt/apt.conf.d/docker-gzip-indexes renamed to debootstrap/bullseye/rootfs/etc/apt/apt.conf.d/docker-gzip-indexes

File renamed without changes.

bullseye/rootfs/etc/apt/apt.conf.d/docker-no-languages renamed to debootstrap/bullseye/rootfs/etc/apt/apt.conf.d/docker-no-languages

File renamed without changes.

0 commit comments

Comments
 (0)