diff --git a/ext/central-controller-docker/Dockerfile b/ext/central-controller-docker/Dockerfile index 2fc92e6f9..716390f82 100644 --- a/ext/central-controller-docker/Dockerfile +++ b/ext/central-controller-docker/Dockerfile @@ -1,19 +1,26 @@ # Dockerfile for ZeroTier Central Controllers -FROM centos:7 +FROM centos:7 as builder MAINTAINER Adam Ierymekno , Grant Limberg +ARG git_branch=master + RUN yum update -y RUN yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm -RUN yum install -y bash postgresql10 libpqxx-devel - RUN yum -y install epel-release && yum -y update && yum clean all -RUN yum -y install clang jemalloc jemalloc-devel +RUN yum groupinstall -y "Development Tools" +RUN yum install -y bash postgresql10 postgresql10-devel libpqxx-devel glibc-static libstdc++-static clang jemalloc jemalloc-devel +RUN git clone http://git.int.zerotier.com/zerotier/ZeroTierOne.git +RUN if [ "$git_branch" != "master" ]; then cd ZeroTierOne && git checkout -b $git_branch origin/$git_branch; fi +RUN ldconfig +RUN cd ZeroTierOne && make central-controller -ADD zerotier-one /usr/local/bin/zerotier-one +FROM centos:7 + +COPY --from=builder /ZeroTierOne/zerotier-one /usr/local/bin/zerotier-one RUN chmod a+x /usr/local/bin/zerotier-one -ADD docker/main.sh / +ADD ext/central-controller-docker/main.sh / RUN chmod a+x /main.sh ENTRYPOINT /main.sh diff --git a/make-linux.mk b/make-linux.mk index 9fd4f7b95..b31811437 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -334,8 +334,8 @@ docker: FORCE central-controller: FORCE make -j4 LDLIBS="-L/usr/pgsql-10/lib/ -lpq -Lext/librabbitmq/centos_x64/lib/ -lrabbitmq" CXXFLAGS="-I/usr/pgsql-10/include -I./ext/librabbitmq/centos_x64/include -fPIC" DEFS="-DZT_CONTROLLER_USE_LIBPQ -DZT_CONTROLLER" ZT_OFFICIAL=1 ZT_USE_X64_ASM_ED25519=1 one -central-controller-docker: central-controller - docker build -t docker.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f ext/central-controller-docker/Dockerfile . +central-controller-docker: FORCE + docker build -t docker.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f ext/central-controller-docker/Dockerfile --build-arg git_branch=`git name-rev --name-only HEAD` . debug: FORCE make ZT_DEBUG=1 one