Based on farfui/3cx.
If you run the container on an APPARMOR enabled machine you have to add --security-opt apparmor=unconfined to the run command.
docker network create \
-d macvlan \
--subnet 192.168.1.0/24 \
--gateway 192.168.1.1 \
-o parent=eth0 3cxnet
docker run \
-d \
--hostname {YOUR HOSTNAME} \
--memory 1g \
--ip {IP ADDRESS} \
--network 3cxnet \
--restart unless-stopped \
-v 3cx_backup:/mnt/backup \
-v 3cx_recordings:/mnt/recordings \
-v 3cx_log:/var/log \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
--cap-add SYS_ADMIN \
--name 3cx \
58voip/3cx:latest
docker exec 3cx timedatectl set-timezone {YOUR ZONE INFO}
Check timezone with command: docker exec 3cx timedatectl status .
docker exec -ti 3cx /usr/sbin/3CXWizard --cleanup
FROM debian:buster
ARG BUILD_STRING
ARG BUILD_DATE
ARG BUILD_TIME
LABEL build.string $BUILD_STRING
LABEL build.date $BUILD_DATE
LABEL build.time $BUILD_TIME
ENV DEBIAN_FRONTEND noninteractive
ENV LANG en_US.UTF-8
ENV LANGUAGE en
ENV container docker
RUN sed -i 's/deb.debian.org/mirrors.163.com/g' /etc/apt/sources.list \
&& sed -i 's/security.debian.org/mirrors.163.com/g' /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --allow-unauthenticated \
apt-utils \
wget \
gnupg2 \
systemd \
locales \
&& sed -i 's/\# \(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
&& wget -O- http://downloads-global.3cx.com/downloads/3cxpbx/public.key | apt-key add - \
&& echo "deb http://downloads-global.3cx.com/downloads/debian buster main" | tee /etc/apt/sources.list.d/3cxpbx.list \
&& apt-get update -y \
&& apt-get install -y --allow-unauthenticated \
net-tools \
dphys-swapfile \
$(apt-cache depends 3cxpbx | grep Depends | sed "s/.*ends:\ //" | tr '\n' ' ') \
&& rm -f /lib/systemd/system/multi-user.target.wants/* \
&& rm -f /etc/systemd/system/*.wants/* \
&& rm -f /lib/systemd/system/local-fs.target.wants/* \
&& rm -f /lib/systemd/system/sockets.target.wants/*udev* \
&& rm -f /lib/systemd/system/sockets.target.wants/*initctl* \
&& rm -f /lib/systemd/system/basic.target.wants/* \
&& rm -f /lib/systemd/system/anaconda.target.wants/*
EXPOSE 80/tcp 443/tcp 5015/tcp 5000/tcp 5001/tcp 5060/tcp 5060/udp 5061/tcp 5090/tcp 5090/udp 7000-10999/udp
CMD ["/lib/systemd/systemd"]
#!/bin/bash
VERSION=latest
USER=58voip
docker rmi ${USER}/3cx:${VERSION}
docker build \
--force-rm \
--no-cache \
--build-arg BUILD_STRING="$(date -u)" \
--build-arg BUILD_DATE="$(date +%d-%m-%Y)" \
--build-arg BUILD_TIME="$(date +%H:%M:%S)" \
-t 3cx_stage1 .
docker run \
-d \
--privileged \
--name 3cx_stage1_c 3cx_stage1
docker exec 3cx_stage1_c bash -c \
" systemctl mask systemd-logind console-getty.service [email protected] getty-static.service [email protected] [email protected] getty.target \
&& systemctl enable nginx exim4 postgresql \
&& echo 1 | apt-get -y install 3cxpbx"
docker stop 3cx_stage1_c
docker commit 3cx_stage1_c ${USER}/3cx:${VERSION}
docker push ${USER}/3cx:${VERSION}
docker rm 3cx_stage1_c
docker rmi 3cx_stage1
Content type
Image
Digest
sha256:ebeb51cb4…
Size
436.6 MB
Last updated
over 2 years ago
docker pull 58voip/3cx