feat: openwrt docker recipe
arcad/emissary-firmware/pipeline/head There was a failure building this commit Details

This commit is contained in:
wpetit 2024-03-13 10:42:53 +01:00
parent ede2142b9f
commit 772f3fff61
4 changed files with 51 additions and 0 deletions

View File

@ -87,6 +87,8 @@ $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH):
cp -rf files/* $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH)/
custom-files: $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH)
flash:
OPENWRT_DEVICE=$(OPENWRT_DEVICE) OPENWRT_PROFILE=$(OPENWRT_PROFILE) OPENWRT_VERSION=$(OPENWRT_VERSION) misc/script/flash.sh

View File

@ -25,6 +25,13 @@ main() {
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow 42521 on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='42521'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
# Disable DNS-rebind protection

21
misc/docker/Dockerfile Normal file
View File

@ -0,0 +1,21 @@
ARG OPENWRT_VERSION=
ARG CUSTOM_FILES=
ARG ADDITIONAL_OPENWRT_PACKAGES=
FROM reg.cadoles.com/proxy_cache/openwrt/rootfs:x86-64-${OPENWRT_VERSION}
COPY files/ /
COPY misc/x86/uci/ /etc/config/
COPY misc/x86/uci-defaults/ /etc/uci-defaults/
RUN mkdir -p /var/lock \
&& mkdir -p /var/run \
&& opkg update \
&& opkg install dmidecode ${ADDITIONAL_OPENWRT_PACKAGES} \
&& rm /var/opkg-lists/* \
&& /etc/init.d/emissary-agent enable
STOPSIGNAL SIGKILL
CMD ["/sbin/init"]

21
targets/docker.mk Normal file
View File

@ -0,0 +1,21 @@
DOCKER_REPOSITORY ?= reg.cadoles.com/cadoles
DOCKER_CMD ?=
all: docker
docker:
$(MAKE) OPENWRT_TARGET="docker" EMISSARY_ARCH="amd64" custom-files
docker build \
--build-arg OPENWRT_VERSION=$(OPENWRT_VERSION) \
--build-arg ADDITIONAL_OPENWRT_PACKAGES=$(ADDITIONAL_OPENWRT_PACKAGES) \
-t $(DOCKER_REPOSITORY)/emissary-agent:latest \
-f misc/docker/Dockerfile \
.
run-docker:
docker run \
-it --rm \
--name emissary-agent \
-p 42521:42521 \
$(DOCKER_REPOSITORY)/emissary-agent:latest \
$(DOCKER_CMD)