diff --git a/Dockerfile b/Dockerfile index d4ad000..8ace813 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/make.d/__init.mk b/make.d/__init.mk index 3f78182..e409cea 100644 --- a/make.d/__init.mk +++ b/make.d/__init.mk @@ -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 diff --git a/make.d/_make.mk b/make.d/_make.mk index 50a2f50..36eaaf2 100644 --- a/make.d/_make.mk +++ b/make.d/_make.mk @@ -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 @@ -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" @@ -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 diff --git a/make.d/db.mk b/make.d/db.mk index 0686dfa..54d6992 100644 --- a/make.d/db.mk +++ b/make.d/db.mk @@ -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" @@ -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) diff --git a/make.d/help.mk b/make.d/help.mk index ec42706..28f725d 100644 --- a/make.d/help.mk +++ b/make.d/help.mk @@ -5,7 +5,7 @@ all-help: help commentary .PHONY: help -help: help-update +help: cat /etc/motd $(warning Help is work-in-progress...) diff --git a/make.d/langs.mk b/make.d/langs.mk index 13e4b2e..a74b59b 100644 --- a/make.d/langs.mk +++ b/make.d/langs.mk @@ -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 diff --git a/make.d/midi.mk b/make.d/midi.mk index 1d91b13..2db5100 100644 --- a/make.d/midi.mk +++ b/make.d/midi.mk @@ -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 \ diff --git a/make.d/nodered.mk b/make.d/nodered.mk index 97d4a15..b965f3c 100644 --- a/make.d/nodered.mk +++ b/make.d/nodered.mk @@ -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 diff --git a/make.d/text.mk b/make.d/text.mk index d1407bf..8891fa2 100644 --- a/make.d/text.mk +++ b/make.d/text.mk @@ -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