run container with host and none network:
httpfileserver
docker run -it --name openwrthttpfileserver --security-opt seccomp=unconfined --security-opt apparmor=docker-default -p 0.0.0.0:8000:8000 --net=host --net=none --runtime io.containerd.runc.v2 -e NETWORK_IF=vxlanwan -e NETWORK_NONE=lo --platform=linux/amd64 -v /srv/www/htdocs/:/usr/share/apache2/htdocs/ -v /etc/config:/etc/config --cap-add=NET_ADMIN --kernel-memory=6M --privileged --tmpfs /opt/docker jgsoftwares/openwrthttpfileserver:shell /bin/ash runhttpfileserver.sh
and run command
sysctl -w net.ipv4.ip_forward=0
sysctl -w net.ipv6.conf.all.disable_ipv6=0 \
a simple compose file \
start file docker-compose.yml
start the file with command
docker-compose up -d --build
access to container
docker exec -it composehttp /bin/ash apachectl restart
\
services:
composehttp:
stdin_open: true
tty: true
platform: linux/amd64
container_name: composehttp
restart: unless-stopped
network_mode: host
cap_add:
- NET_ADMIN
- SYS_ADMIN
privileged: true
tmpfs: /opt/docker
image: jgsoftwares/openwrthttp
#command: /bin/ash apachectl r
start httpfileserver with
apachectl restart \
setup timeserver
opkg install alpine-repositories
apk add --allow-untrusted tzdata
rm -rf /etc/localtime
echo "CET-1CEST,M3.5.0,M10.5.0/3" > /etc/TZ \ # de
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
date \
login to the container to start the apache server
docker exec -it openwrthttpfileserver /bin/ash
start the server with
apachectl restart
a simple http fileserver form host path
/srv/www/htdocs/ \
simple apache2 proxy reverse
run docker container with:
docker run -it --name openwrhttpreverseproxy --net=host --net=none --runtime io.containerd.runc.v2 -v /var/run/ubus/ubus.sock:/var/run/ubus/ubus.sock --privileged --tmpfs /opt/docker jgsoftwares/openwrthttpfileserver:
firejailreverseproxy /bin/ash
apache server has to start manuly with
apachectl
in the container
edit config the httpd.conf file in the container with
docker exec -it openwrthttpreverseproxy /bin/ash
vi /etc/apache2/httpd.conf
start the server with
apachectl restart
Content type
Image
Digest
sha256:9f5786b03…
Size
151.7 MB
Last updated
about 1 year ago
docker pull jgsoftwares/openwrthttpfileserver