Skip to content

Commit

Permalink
minor update for -max image
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyFi Geek committed Oct 25, 2024
1 parent 6f6d021 commit d3b89be
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ COPY .gitignore /app/.gitignore
# basically some "inetd" things, common
RUN make -d --warn-undefined-variables -f /app/make.d/__init.mk
# include any "extra packages", like "install-all", using make.d Makefile
RUN make -C /app --debug=bjv --warn-undefined-variables -j 64 ${DOCKER_ADDITIONAL_TARGETS}
RUN make -C /app -d -j 16 --warn-undefined-variables ${DOCKER_ADDITIONAL_TARGETS}
# todo: keeping 2nd RUN seperate to see in build to debug, but should be combined with && above

# IMPORTANT: CMD and ENTRYPOINT must use array syntax - otherwise args don't work

# make is entrypoint - see README.md for details on this approach
ENTRYPOINT ["make", "--debug=bjv", "--jobs=512", "--warn-undefined-variables"]
ENTRYPOINT ["make", "--debug=bjv", "--jobs=64", "--warn-undefined-variables"]
# note: the "-j 10" is the job limit for parallel jobs, by default its 2
# but as an "init" process

Expand Down
2 changes: 1 addition & 1 deletion make.d/__init.mk
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ define usr_local_bin_mk
#!/bin/sh
SAVEDIR=`pwd`
cd /app
make $(MK_FLAGS) -j 512 $$@
make $(MK_FLAGS) -j 32 $$@
cd $$SAVEDIR
endef

Expand Down
10 changes: 5 additions & 5 deletions make.d/_make.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ upgrade: check-for-updates
.PHONY: install-everything install-all install-all-tools install-all-services install-all-built
install-everything: install-all install-all-built tools-all-langs
install-all: install-all-tools install-all-services install-all-built
install-all-tools: tools-extras tools-mail tools-games tools-dns tools-db tools-all-text tools-serial tools-all-vpns tools-video tools-files tools-cloud all-help
install-all-services: add-nodered add-mosquitto add-postgres add-bind9 add-blocky add-caddy add-traefik add-lighttpd
install-all-tools: tools-extras tools-mail tools-games tools-dns tools-db tools-all-text tools-serial tools-all-vpns tools-video tools-files tools-cloud all-help add-python3 add-nodejs
install-all-services: add-mosquitto add-postgres add-bind9 add-blocky add-caddy add-traefik add-lighttpd
install-all-built: build-src

.PHONY: build-src build-src-linux build-src-go build-src-rust
Expand All @@ -53,7 +53,7 @@ build-src-linux: add-midimonster add-librouteros-dev
build-src-go:
$(warning build-src skips go for armv6 and armv7)
build-src-rust:
$(warning build-src skips go for armv6 and armv7)
$(warning build-src skips rust for armv6 and armv7)
endif

# these are just more "problematic", always skip them even when "all" and "everything"
Expand All @@ -67,8 +67,8 @@ stress-build-src: build-src add-pocketbase add-erlang-tui add-cute-tui add-mdboo
.PHONY: stress-services stress-services-nobuild stress-services-built stress-services-nobuild-unwise
stress-services: stress-services-nobuild stress-services-built stress-subcommands
stress-services-nobuild: TRAEFIK_ENTRYPOINTS_HTTP_ADDRESS = :8082
stress-services-nobuild: sshd syslogd telnetd mqtt nodered blocky lighttpd bind9 caddy traefik
stress-services-nobuild-unwise: postgres
stress-services-nobuild: sshd syslogd telnetd mqtt blocky lighttpd bind9 caddy traefik
stress-services-nobuild-unwise: postgres nodered
stress-services-built: pocketbase midimonster

.PHONY: stress-subcommands
Expand Down
17 changes: 10 additions & 7 deletions make.d/db.mk
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@


.PHONY: tools-db
tools-db: add-sqlite add-redis
tools-db: add-sqlite

# todo: if postgres is only target it container will stop since Makefile will finish
# ... while goal is all services wait in foreground in make.d - postgres violates it.
# note: it's expected for larger database needs, a seperate instance should be used & postgres is picky

.PHONY: postgres
PGDATA ?= /app/postgres/data
ifneq (,$(findstring armv,$(UNAME_MACHINE)))
.PHONY: postgres add-postgres
postgres:
$(warning postgress is not supported on 32-bit ARM)
add-postgres:
$(warning postgress is not supported on 32-bit ARM)
else
.PHONY: postgres
# from: https://luppeng.wordpress.com/2020/02/28/install-and-start-postgresql-on-alpine-linux/
postgres: /app/postgres/data/postgresql.conf /usr/bin/pg_ctl /run/postgresql
# su postgres -c "echo 'unix_socket_directories = /tmp' >> /app/postgres/data/postgresql.conf"
Expand Down Expand Up @@ -49,13 +55,10 @@ pqsl:
su postgres -c "echo 'host all all 0.0.0.0/0 md5' >> /app/postgres/data/pg_hba.conf"
su postgres -c "echo listen_addresses=\'*\' >> /app/postgres/data/postgresql.conf"
# su postgres -c "echo unix_socket_directories=\'/app/postgres/run\' >> /app/postgres/data/postgresql.conf"
endif

.PHONY: add-sqlite
add-sqlite: /usr/bin/sqlite3
.PRECIOUS: /usr/bin/sqlite3
/usr/bin/sqlite3:
$(call apk_add, sqlite sqlite-doc sqlite-tools)

.PHONY: redis
add-redis:
$(call apk_add, redis)
2 changes: 1 addition & 1 deletion make.d/help.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
all-help: help commentary

.PHONY: help
help: help-update
help:
cat /etc/motd
$(warning Help is work-in-progress...)

Expand Down
6 changes: 6 additions & 0 deletions make.d/langs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ add-nodejs: /usr/bin/node
/usr/bin/node:
$(call apk_add, nodejs nodejs-doc npm npm-doc yarn)

.PHONY: add-lua53
add-lua53: /usr/bin/lua5.3
/usr/bin/lua5.3:
$(call apk_add, lua5.3 lua5.3-libs lua5.3-doc lua5.3-mosquitto lua5.3-sqlite lua5.3-toml lua5.3-yaml lua5.3-http lua5.3-curl lua5.3-apk lua5.3-ansicolors lua5.3-jsonschema)


.PHONY: add-golang
add-golang: /usr/bin/go
.PRECIOUS: /usr/bin/go
Expand Down
4 changes: 2 additions & 2 deletions make.d/midi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ midimonster-drivers: midimonster
# note: this is NOT a .PHONY - we actually want to check if FILE EXIST - here 'midimonster'
# if not... get tools, build it, and remove build-only tools
.PRECIOUS: /usr/local/bin/midimonster
/usr/local/bin/midimonster: /usr/local/src/midimonster/Makefile /usr/local/src/midimonster/patches
/usr/local/bin/midimonster: /usr/local/src/midimonster/Makefile /usr/local/src/midimonster/patches add-lua53
# these APKs use at runtime for midimonster
$(call apk_add, $(MIDI_EXTRA_APKS) openssl lua5.3 lua5.3-libs)
$(call apk_add, $(MIDI_EXTRA_APKS) openssl)
# Linux dev tools/libraries used to build only (and removed)
$(call build_apk_addgroup, .build-midimonster, \
git \
Expand Down
9 changes: 5 additions & 4 deletions make.d/nodered.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@

.PHONY: nodered
NODERED_OPTS ?=
nodered: add-nodered
nodered: add-nodejs add-nodered
mkdir -p /app/node-red
node-red --userDir /app/node-red $(NODERED_OPTS)

.PHONY: add-nodered
add-nodered: /usr/local/bin/node-red
add-nodered: add-nodejs /usr/local/bin/node-red

/usr/local/bin/node-red: /usr/bin/node
.PRECIOUS: /usr/local/bin/node-red
/usr/local/bin/node-red: add-nodejs
npm install -g --unsafe-perm node-red

.PHONY: nodered-update
nodered-update:
nodered-update: add-nodered
npm update
npm upgrade node-red
1 change: 1 addition & 0 deletions make.d/text.mk
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ add-mdbook-man: /usr/bin/mdbook /usr/local/bin/mdbook-man
.PRECIOUS: /usr/bin/mdbook
/usr/bin/mdbook:
$(call apk_add, mdbook)
.PRECIOUS: /usr/local/bin/mdbook-man
/usr/local/bin/mdbook-man: /usr/bin/mdbook
$(call build_apk_addgroup, .mdbook-man, cargo)
cargo install mdbook-man
Expand Down

0 comments on commit d3b89be

Please sign in to comment.