Docker Hub

/ Knowledge base / Virtualization / Docker Usage

SoftEtherVPN with Alpine Linux
# Simple
docker run -d --name softethervpn --privileged --net host fserver/softethervpn
docker logs softethervpn

# Setting your user/password/psk
docker run -d --name softethervpn --privileged --net host -e PSK=server -e USERNAME=root -e PASSWORD=P@ssw0rd fserver/softethervpn
Asterisk with Alpine Linux
# Passthrough all port to container (recomended)
docker run -d -t --privileged=true --net="host" --name asterisk fserver/asterisk

# Passthrough only ones you need (dont forget to edit rtp.conf)
docker run -d -p 5060:5060 -p XXXX:XXXX  -v :/etc/asterisk -v :/var/spool/asterisk/monitor -v :/var/spool/asterisk/voicemail --name asterisk fserver/asterisk

# Asterisk CLI:
docker exec -it asterisk asterisk -rvvvv

# example:
docker run -d -t --privileged=true --net="host" --restart=always -v /data/asterisk/etc:/etc/asterisk -v /data/asterisk/monitor:/var/spool/asterisk/monitor -v /data/asterisk/voicemail:/var/spool/asterisk/voicemail --name asterisk fserver/asterisk
LetsEncrypt Certbot with Alpine Linux (v0.9.3)
#1. Add aliases to your web server for all domains you need cert:
# nginx:
#  location /.well-known/ { alias /usr/share/nginx/html/.well-known/; }
# httpd:
#  Alias /.well-known/ /usr/share/nginx/html/.well-known/

# 2. Fetch certs

docker run -it --rm -v /etc/ssl/letsencrypt:/etc/letsencrypt/ -v /usr/share/nginx/html/:/var/www/ fserver/certbot certbot certonly --agree-tos -t -m --webroot -w /var/www/ -d -d

# /etc/ssl/letsencrypt - dir with letsencrypt data, certs you will find at /etc/ssl/letsencrypt/live/
# /usr/share/nginx/html/ - dir shared via web server for domain check
# add all domains you need with -d

# 3. Update certs manualy with

docker run -it --rm -v /etc/ssl/letsencrypt:/etc/letsencrypt/ -v /usr/share/nginx/html/:/var/www/ fserver/certbot certbot renew

# or add to crontab:
echo "1 1 * * sat root docker run -it --rm -v /etc/ssl/letsencrypt:/etc/letsencrypt/ -v /usr/share/nginx/html/:/var/www/ fserver/certbot certbot renew" >> /etc/crontab
Samba 4.5.x with Alpine Linux
docker run -d -t -v /your/smb.conf:/etc/samba/smb.conf -v /public/share:/share --restart=always --net=host --name samba fserver/samba
Squid 3.5.x with Alpine Linux
# Normal Proxy
docker run  -v configPath/squid.conf:/etc/squid/squid.conf:ro \
            -v configPath/cache:/var/cache/squid:rw \
            -v /var/log/squid:/var/log/squid:rw \
            -v /etc/localtime:/etc/localtime:ro \
            -p 3128:3128 -p 3129:3129 \
            --name squid -d -t fserver/squid

# Transparent Proxy
docker run  -v configPath/squid.conf:/etc/squid/squid.conf:ro \
            -v configPath/cache:/var/cache/squid:rw \
            -v /var/log/squid:/var/log/squid:rw \
            -v /etc/localtime:/etc/localtime:ro \
            --privileged=true --net=host \
            --name squid -d -t fserver/squid


curl -o /etc/yum.repos.d/fserver.repo

Manual installation:
yum install -y epel-release
cat << EOF >> /etc/yum.repos.d/fserver.repo
baseurl =\$releasever/\$basearch/
enabled = 1
gpgcheck = 0
name = FServer EL repo

rm -f /etc/yum.repos.d/fserver.repo

Sources on GitHub