#Download base image ubuntu 16.04 FROM ubuntu:16.04 LABEL version="1.0" LABEL maintainer="Thomas Roehm" ENV SQUID_VERSION="4.8" ENV SQUIDURL="http://www.squid-cache.org/Versions/v4/squid-${SQUID_VERSION}.tar.gz" #ENV https_proxy "http://my-proxy:80" #ENV http_proxy "http://my-proxy:80" #ENV no_proxy "localhost,127.0.0.1,myhost.local" # locales to UTF-8 #RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8 #ENV LC_ALL C.UTF-8 #ENV SQUID_VERSION=3.5.12-1ubuntu7 #SQUID_CACHE_DIR=/var/spool/squid #SQUID_LOG_DIR=/var/log/squid #SQUID_USER=proxy RUN apt-get update RUN apt-get -y upgrade #RUN apt-get -y dist-upgrade #RUN DEBIAN_FRONTEND=noninteractive RUN apt-get install -y build-essential RUN apt-get install -y net-tools RUN apt-get install -y wget RUN apt-get install -y libssl-dev RUN apt-get install -y telnet RUN apt-get install -y vim RUN apt-get -qy autoremove #RUN rm -rf /var/lib/apt/lists/* #WORKDIR /data/ RUN wget ${SQUIDURL} RUN tar -xzf squid-${SQUID_VERSION}.tar.gz RUN cd /squid-${SQUID_VERSION} && ./configure --with-large-files --enable-follow-x-forwarded-for --sysconfdir=/etc/squid --localstatedir=/var/log/squid --enable-ssl --with-openssl --with-filedescriptors=16384 --enable-storeio=diskd,ufs --prefix=/usr/local/squid --with-included-ltdl RUN cd /squid-${SQUID_VERSION} && make && make install RUN useradd -r squid -s /bin/false RUN cat /etc/passwd #RUN groupadd -r squid RUN touch /var/log/squid/logs/access.log RUN cd /var/log/squid/ && chmod -R 770 * && chown -R squid:squid * RUN chmod 640 /var/log/squid/logs/access.log #COPY entrypoint.sh /test/entrypoint.sh #RUN chmod 750 /test/entrypoint.sh COPY squid-init /etc/init.d/squid https://docs.docker.com/engine/security/certificates/ RUN chmod 750 /etc/init.d/squid COPY squid.conf /etc/squid/squid.conf #CMD "./entrypoint.sh" #ENTRYPOINT ["/usr/local/squid/sbin/squid", ] #CMD ["-z"] ENTRYPOINT /usr/local/squid/sbin/squid -z && sleep 10 && /etc/init.d/squid start && echo "Squid started" || echo "Squid could not start, exit" && bash #CMD ["--help"] #ENTRYPOINT "/sbin/entrypoint.sh && /bin/bash" #EXPOSE 8080/tcp #CMD ["/usr/local/squid/sbin/squid -z"] #ENTRYPOINT ["/etc/init.d/squid","start"] #CMD ["/bin/bash", "/usr/local/bin/start.sh"] #CMD ["/etc/init.d/squid","start"] #CMD ["start"] #CMD ["start", "batman", "superman"] #CMD ["/bin/bash", "/sbin/entrypoint.sh"] #example ENTRYPOINT service nginx start && service ssh start && /bin/bash "use && to separate your code" #ENTRYPOINT ["/sbin/entrypoint.sh"]