feat: openwrt docker recipe
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
This commit is contained in:
parent
ede2142b9f
commit
772f3fff61
2
Makefile
2
Makefile
@ -87,6 +87,8 @@ $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH):
|
|||||||
|
|
||||||
cp -rf files/* $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH)/
|
cp -rf files/* $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH)/
|
||||||
|
|
||||||
|
custom-files: $(IMAGEBUILDER_CUSTOM_FILES_DIR_PATH)
|
||||||
|
|
||||||
flash:
|
flash:
|
||||||
OPENWRT_DEVICE=$(OPENWRT_DEVICE) OPENWRT_PROFILE=$(OPENWRT_PROFILE) OPENWRT_VERSION=$(OPENWRT_VERSION) misc/script/flash.sh
|
OPENWRT_DEVICE=$(OPENWRT_DEVICE) OPENWRT_PROFILE=$(OPENWRT_PROFILE) OPENWRT_VERSION=$(OPENWRT_VERSION) misc/script/flash.sh
|
||||||
|
|
||||||
|
@ -25,6 +25,13 @@ main() {
|
|||||||
uci set firewall.@rule[-1].dest_port='443'
|
uci set firewall.@rule[-1].dest_port='443'
|
||||||
uci set firewall.@rule[-1].target='ACCEPT'
|
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
|
uci commit firewall
|
||||||
|
|
||||||
# Disable DNS-rebind protection
|
# Disable DNS-rebind protection
|
||||||
|
21
misc/docker/Dockerfile
Normal file
21
misc/docker/Dockerfile
Normal 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
21
targets/docker.mk
Normal 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)
|
Loading…
Reference in New Issue
Block a user