├── LICENSE ├── README.md ├── amwiki └── Dockerfile ├── aria2 ├── Dockerfile ├── Dockerfile.client ├── Dockerfile.server ├── README.md └── aria2 │ ├── aria2c.conf │ └── run.sh ├── base ├── README.md ├── base │ ├── Dockerfile │ └── edge │ │ └── Dockerfile ├── gcc │ ├── Dockerfile │ └── dev │ │ └── Dockerfile ├── golang │ ├── Dockerfile │ └── dev │ │ └── Dockerfile ├── java │ ├── README.md │ ├── openjdk-jre-1.8 │ │ ├── Dockerfile │ │ └── README.md │ ├── openjdk-jre-dev-1.8 │ │ ├── Dockerfile │ │ └── README.md │ └── oracle-jdk-1.8 │ │ ├── Dockerfile │ │ └── README.md ├── node │ ├── Dockerfile │ ├── README.md │ └── dev │ │ ├── Dockerfile │ │ └── README.md ├── php │ ├── README.md │ ├── php5 │ │ ├── Dockerfile │ │ └── dev │ │ │ ├── Dockerfile │ │ │ └── README.md │ └── php7 │ │ ├── Dockerfile │ │ └── dev │ │ ├── Dockerfile │ │ └── README.md └── python │ ├── README.md │ ├── python2 │ ├── Dockerfile │ ├── README.md │ └── dev │ │ ├── Dockerfile │ │ └── README.md │ └── python3 │ ├── Dockerfile │ ├── README.md │ └── dev │ ├── Dockerfile │ └── README.md ├── cloud9-ide ├── Dockerfile ├── Dockerfile.full ├── Dockerfile.swift ├── Dockerfile.ubuntu └── README.md ├── cloudstack ├── Dockerfile ├── README.md └── supervisord.conf ├── compose ├── Dockerfile └── README.md ├── dog-tunnel └── Dockerfile ├── eclipse-che ├── Dockerfile ├── README.md ├── che.properties └── wrapdocker ├── firefox └── Dockerfile ├── ghost-buster ├── LICENSE ├── README.md ├── build │ ├── Dockerfile │ ├── publish.sh │ └── start.bash ├── docker-compose.yml └── setup-all.sh ├── glusterfs ├── Dockerfile ├── Dockerfile.client ├── Dockerfile.server ├── client │ ├── run.sh │ └── supervisord.conf ├── docker-compose.yml └── server │ ├── run.sh │ └── supervisord.conf ├── grav ├── Dockerfile ├── Dockerfile.old └── files │ ├── nginx.conf │ ├── php-fpm.conf │ └── run.sh ├── hackpad ├── Dockerfile ├── README.md └── docker-entrypoint.sh ├── hans └── Dockerfile ├── hexo ├── Dockerfile ├── docker-compose.yml ├── font-spider │ └── Dockerfile └── monitor.sh ├── hugo ├── Dockerfile ├── build.sh ├── minify │ ├── Dockerfile │ ├── gulpfile.babel.js │ ├── html │ │ └── indec.html │ ├── package.json │ └── run.sh └── run.sh ├── kodexplorer-lamp ├── Dockerfile └── README.md ├── leanote ├── Dockerfile ├── README.md ├── app.conf ├── docker-compose.yml ├── get-data.sh ├── initdb.sh └── src │ ├── Dockerfile │ ├── README.md │ ├── docker-compose.yml │ ├── get-src.sh │ └── initdb.sh ├── lepto └── Dockerfile ├── lnmp ├── app │ ├── index.html │ └── index.php ├── conf.d │ └── default.conf ├── docker-compose.yml └── php │ └── php.ini-production ├── lxde-vnc-ubuntu ├── Dockerfile ├── README.md ├── build.sh ├── startup.sh └── supervisord.conf ├── mongo └── Dockerfile ├── mongodb-tools └── Dockerfile ├── nextcloud ├── Dockerfile └── docker-entrypoint.sh ├── nginx-ssh ├── Dockerfile ├── README.md ├── app │ └── index.html ├── run.sh ├── set_root_pw.sh └── sites-enabled │ └── default ├── october ├── Dockerfile └── README.md ├── pagekit ├── Dockerfile ├── README.md ├── docker-compose.yml ├── nginx.conf └── pagekit-sqlite │ ├── Dockerfile │ ├── README.md │ ├── docker-compose.yml │ └── nginx.conf ├── php-apache ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── run.sh └── sample │ └── index.php ├── ptunnel ├── ._CHANGELOG ├── ._LICENSE ├── ._README ├── ._ptunnel.8 ├── ._ptunnel.c ├── ._ptunnel.h ├── CHANGELOG ├── Dockerfile ├── Dockerfile.server ├── LICENSE ├── Makefile ├── README ├── client.sh ├── entrypoint.sh ├── md5.c ├── md5.h ├── ptunnel-debian │ ├── Dockerfile │ └── Dockerfile.server ├── ptunnel.8 ├── ptunnel.c ├── ptunnel.h ├── redhat │ ├── ._ptunnel.spec │ └── ptunnel.spec ├── selinux │ ├── CVS │ │ ├── Entries │ │ ├── Repository │ │ └── Root │ └── ptunnel.te ├── server.sh └── web │ ├── ._index.html │ ├── ._setup.png │ ├── index.html │ ├── packet-format.png │ └── setup.png ├── restic └── Dockerfile ├── shadowsocks-ubuntu ├── multi-user │ ├── Dockerfile │ ├── README.md │ ├── shadowsocks.json │ └── start.sh └── single-user │ ├── Dockerfile │ ├── README.md │ ├── shadowsocks.json │ └── start.sh ├── shadowsocksr ├── README.md ├── client_docker_compose.yaml ├── kcp_Dockerfile ├── proxy.pac ├── server_docker_compose.yaml ├── ssr.json └── ssr_Dockerfile ├── shellinabox ├── Dockerfile └── README.md ├── ssdb ├── Dockerfile ├── README.md ├── docker-compose.yml └── ssdb.conf ├── tensorflow-go ├── Dockerfile ├── Dockerfile.py3 └── get-pip.py ├── typecho ├── Caddyfile ├── Dockerfile.beta ├── Dockerfile.caddy ├── Dockerfile.nginx ├── README.md ├── nginx.conf └── supervisord.conf ├── uploads ├── Dockerfile ├── nginx.conf └── script │ ├── assets │ ├── css │ │ └── style.css │ ├── img │ │ ├── border-image.png │ │ └── icons.png │ └── js │ │ ├── jquery.fileupload.js │ │ ├── jquery.iframe-transport.js │ │ ├── jquery.knob.js │ │ ├── jquery.min.js │ │ ├── jquery.ui.widget.js │ │ └── script.js │ ├── index.html │ └── upload.php └── vim └── Dockerfile /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 ZuoLan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dockerfiles 2 | 3 | ![Docker](https://assets-cdn.github.com/images/icons/emoji/unicode/1f433.png) 4 | 5 | There are README within the folders. 6 | 7 | # Contact me 8 | No matter where I am, will be immediately received. 9 | My Email: `echo "aUB6dW9sYW4ubWUK" | base64 -d` 10 | 11 | ## Catalogue 12 | | Project | Description | 13 | | ---------------------------------------- | ---------------------------------------- | 14 | | [base](https://github.com/izuolan/dockerfiles/blob/master/base) | Base Images, All major programming language. | 15 | | [cloud9-ide](https://github.com/izuolan/dockerfiles/blob/master/cloud9-ide) | Cloud9 IDE, learn more https://c9.io . | 16 | | [cloudstack](https://github.com/izuolan/dockerfiles/blob/master/cloudstack) | Cloudstack image, Unfinish. | 17 | | [compose](https://github.com/izuolan/dockerfiles/blob/master/compose) | Compose image, just like native tool. | 18 | | [dog-tunnel](https://github.com/izuolan/dockerfiles/blob/master/dog-tunnel) | A tunnel tool, Dog-tunnel lite client. | 19 | | [eclipse-che](https://github.com/izuolan/dockerfiles/blob/master/eclipse-che) | Eclipse Che image, now it'is deprecated. | 20 | | [firefox](https://github.com/izuolan/dockerfiles/blob/master/firefox) | Firefox in Docker, use x11. | 21 | | [ghost-buster](https://github.com/izuolan/dockerfiles/blob/master/ghost-buster) | Export Ghost blog, as static site. | 22 | | [glusterfs](https://github.com/izuolan/dockerfiles/blob/master/glusterfs) | Glusterfs in Docker, sync folder. | 23 | | [hackpad](https://github.com/izuolan/dockerfiles/blob/master/hackpad) | Dropbox Hackpad. | 24 | | [hexo](https://github.com/izuolan/dockerfiles/blob/master/hexo) | Hexo, static site engine, learn more https://hexo.io . | 25 | | [hugo](https://github.com/izuolan/dockerfiles/blob/master/hugo) | Hugo, static site engine. | 26 | | [kodexporer-lamp](https://github.com/izuolan/dockerfiles/blob/master/kodexporer-lamp) | LAMP and Kodexporer. | 27 | | [leanote](https://github.com/izuolan/dockerfiles/blob/master/leanote) | Leanote, learn more https://leanote.org . | 28 | | [lnmp](https://github.com/izuolan/dockerfiles/blob/master/lnmp) | LNMP with Compose. | 29 | | [lxde-vnc-ubuntu](https://github.com/izuolan/dockerfiles/blob/master/lxde-vnc-ubuntu) | LXDE Desktop in Docker with VNC. | 30 | | [mongo](https://github.com/izuolan/dockerfiles/blob/master/mongo) | Mongo for Alpine image. | 31 | | [mongodb-tools](https://github.com/izuolan/dockerfiles/blob/master/mongodb-tools) | Mongodb Tools for Alpine. | 32 | | [nextcloud](https://github.com/izuolan/dockerfiles/blob/master/nextcloud) | Nextcloud, faster and latest version. | 33 | | [nginx-ssh](https://github.com/izuolan/dockerfiles/blob/master/nginx-ssh) | Nginx and ssh image. | 34 | | [october](https://github.com/izuolan/dockerfiles/blob/master/october) | October CMS image. | 35 | | [pagekit](https://github.com/izuolan/dockerfiles/blob/master/pagekit) | Pagekit CMS image. | 36 | | [php-apache](https://github.com/izuolan/dockerfiles/blob/master/php-apache) | PHP and Apache. | 37 | | [ptunnel](https://github.com/izuolan/dockerfiles/blob/master/ptunnel) | Ptunnel for Alpine. | 38 | | [restic](https://github.com/izuolan/dockerfiles/blob/master/restic) | Restic, A backup image. | 39 | | [shadowsocks-ubuntu](https://github.com/izuolan/dockerfiles/blob/master/shadowsocks-ubuntu) | Shadowsocks on Ubuntu image. | 40 | | [shadowsocksr](https://github.com/izuolan/dockerfiles/blob/master/shadowsocksr) | ShadowsocksR for Alpine. | 41 | | [shellinabox](https://github.com/izuolan/dockerfiles/blob/master/shellinabox) | Shellinabox image. | 42 | | [tensorflow-go](https://github.com/izuolan/dockerfiles/blob/master/tensorflow-go) | Tensorflow and Python and Go in Notebook. | 43 | | [typecho](https://github.com/izuolan/dockerfiles/blob/master/typecho) | Typecho image. | 44 | | [uploads](https://github.com/izuolan/dockerfiles/blob/master/uploads) | Unfinish. | 45 | -------------------------------------------------------------------------------- /amwiki/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | RUN npm install -g amwiki 3 | WORKDIR /wiki 4 | CMD ["amwiki", "server"] 5 | -------------------------------------------------------------------------------- /aria2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | ENV PASSWORD=aria2 3 | COPY aria2 /aria2 4 | RUN apk add --no-cache --update --virtual build-dep wget unzip && \ 5 | apk add aria2 && \ 6 | wget https://github.com/mayswind/AriaNg-DailyBuild/archive/master.zip && \ 7 | unzip master.zip && rm master.zip && \ 8 | rm -rf /usr/share/nginx/html/ && \ 9 | mv /AriaNg-DailyBuild-master/ /usr/share/nginx/html && \ 10 | chmod a+x /aria2/run.sh && apk del build-dep 11 | CMD ["/aria2/run.sh"] 12 | -------------------------------------------------------------------------------- /aria2/Dockerfile.client: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | RUN apk add --no-cache --update --virtual build-dep wget unzip && \ 3 | wget --no-check-certificate https://github.com/mayswind/AriaNg-DailyBuild/archive/master.zip && \ 4 | unzip master.zip && rm master.zip && \ 5 | rm -rf /usr/share/nginx/html/ && \ 6 | mv /AriaNg-DailyBuild-master/ /usr/share/nginx/html && \ 7 | apk del build-dep 8 | -------------------------------------------------------------------------------- /aria2/Dockerfile.server: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | COPY aria2/aria2c.conf /aria2/aria2c.conf 3 | RUN apk add --no-cache aria2 4 | CMD ["aria2", "--conf-path=/aria2/aria2c.conf"] 5 | -------------------------------------------------------------------------------- /aria2/README.md: -------------------------------------------------------------------------------- 1 | #### Aria2 RPC Server + AriaNg Web 2 | 3 | ``` 4 | docker run -d --name aria2 \ 5 | -p 6800:6800 \ 6 | -p 127.0.0.1:6880:80 \ 7 | -e PASSWORD=your_password \ 8 | -v /downloads:/aria2/downloads \ 9 | zuolan/aria2 10 | ``` 11 | 12 | #### Only Aria2 RPC Server 13 | 14 | ``` 15 | docker run -d --name aria2 \ 16 | -p 6800:6800 \ 17 | -e PASSWORD=your_password \ 18 | -v /downloads:/aria2/downloads \ 19 | zuolan/aria2:server 20 | ``` 21 | 22 | #### Only AriaNg Web 23 | 24 | ``` 25 | docker run -d --name aria2 \ 26 | -p 127.0.0.1:6880:80 \ 27 | zuolan/aria2:client 28 | ``` 29 | -------------------------------------------------------------------------------- /aria2/aria2/aria2c.conf: -------------------------------------------------------------------------------- 1 | dir=/aria2/downloads/ 2 | 3 | disk-cache=32M 4 | 5 | file-allocation=trunc 6 | 7 | continue=true 8 | 9 | max-concurrent-downloads=5 10 | 11 | max-connection-per-server=5 12 | 13 | min-split-size=10M 14 | 15 | split=5 16 | 17 | disable-ipv6=true 18 | 19 | enable-rpc=true 20 | 21 | rpc-allow-origin-all=true 22 | 23 | rpc-listen-all=true 24 | 25 | rpc-listen-port=6800 26 | 27 | rpc-secret=RPC_PASSWORD 28 | 29 | listen-port=51413 30 | 31 | enable-dht=false 32 | 33 | enable-peer-exchange=false 34 | 35 | peer-id-prefix=-TR2770- 36 | 37 | user-agent=Transmission/2.77 38 | 39 | seed-ratio=0 40 | 41 | bt-seed-unverified=true 42 | 43 | bt-save-metadata=true 44 | -------------------------------------------------------------------------------- /aria2/aria2/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | mkdir -p aria2/downloads 3 | eval sed -i 's/RPC_PASSWORD/$PASSWORD/g' /aria2/aria2c.conf 4 | 5 | aria2c --conf-path=/aria2/aria2c.conf & 6 | nginx -g "daemon off;" 7 | -------------------------------------------------------------------------------- /base/README.md: -------------------------------------------------------------------------------- 1 | # Docker Images 2 | 3 | The purpose of these images is to provide the smallest possible images for 4 | every major programming language. 5 | 6 | Use the `zuolan/LANGUAGE:dev` images for building/vendoring. 7 | 8 | Use the `zuolan/LANGUAGE` images for running (much smaller than the dev ones). 9 | 10 | Examples for how to use all of these images for each language can be found here: https://github.com/izuolan/dockerfiles 11 | -------------------------------------------------------------------------------- /base/base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN apk update && apk upgrade \ 4 | && apk add ca-certificates \ 5 | && rm -rf /var/cache/apk/* 6 | -------------------------------------------------------------------------------- /base/base/edge/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN apk update && apk upgrade \ 4 | && apk add ca-certificates \ 5 | && rm -rf /var/cache/apk/* 6 | -------------------------------------------------------------------------------- /base/gcc/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN apk update && apk upgrade \ 4 | && apk add ca-certificates libstdc++ \ 5 | && rm -rf /var/cache/apk/* -------------------------------------------------------------------------------- /base/gcc/dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN apk update && apk upgrade \ 4 | && apk add ca-certificates build-base boost \ 5 | && rm -rf /var/cache/apk/* 6 | -------------------------------------------------------------------------------- /base/golang/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN apk update && apk upgrade \ 3 | && apk add ca-certificates \ 4 | && rm -rf /var/cache/apk/* -------------------------------------------------------------------------------- /base/golang/dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \ 4 | && echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \ 5 | && apk update && apk upgrade \ 6 | && apk add ca-certificates curl make git bzr mercurial go@community alpine-sdk \ 7 | && rm -rf /var/cache/apk/* \ 8 | && mkdir /go 9 | ENV GOPATH /go -------------------------------------------------------------------------------- /base/java/README.md: -------------------------------------------------------------------------------- 1 | Docker Hub: https://hub.docker.com/r/zuolan/java/ 2 | 3 | java-dev images are for building, the have the JDK installed. 4 | The "java" ones are for running, they just have the JRE installed. 5 | -------------------------------------------------------------------------------- /base/java/openjdk-jre-1.8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | # openjdk-8-base no contains GUI support. 4 | RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \ 5 | && echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \ 6 | && apk update && apk upgrade \ 7 | && apk add ca-certificates openjdk8-jre-base@community \ 8 | && rm -rf /tmp/* /var/cache/apk/* 9 | -------------------------------------------------------------------------------- /base/java/openjdk-jre-1.8/README.md: -------------------------------------------------------------------------------- 1 | # Java 1.8 JRE Image 2 | 3 | This is a small, [Alpine Linux](http://www.alpinelinux.org/) based Docker image 4 | that contains the Java 1.8 JVM. It's useful for executing Java bytecode, but note 5 | that it doesn't contain the JDK, so you can't use it to compile Java code. 6 | Use java-dev to compile code. 7 | 8 | ## Build 9 | 10 | ```sh 11 | docker build -t yourname/java:latest . 12 | ``` 13 | 14 | Push: 15 | 16 | ```sh 17 | docker push yourname/java 18 | ``` 19 | -------------------------------------------------------------------------------- /base/java/openjdk-jre-dev-1.8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \ 3 | && echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \ 4 | && apk update \ 5 | && apk upgrade \ 6 | && apk add ca-certificates openjdk8@community \ 7 | && rm -rf /var/cache/apk/* 8 | 9 | # set javac PATH 10 | ENV PATH=/usr/lib/jvm/java-1.8-openjdk/bin:$PATH 11 | -------------------------------------------------------------------------------- /base/java/openjdk-jre-dev-1.8/README.md: -------------------------------------------------------------------------------- 1 | # Java 1.8 JDK Image 2 | 3 | This is a small, [Alpine Linux](http://www.alpinelinux.org/) based Docker image 4 | that contains the Java 1.8 JDK. You can use it to compile and execute your Java code. 5 | 6 | ## Build 7 | 8 | ```sh 9 | docker build -t yourname/java:dev . 10 | ``` 11 | 12 | ## Push 13 | 14 | ```sh 15 | docker push yourname/java 16 | ``` 17 | -------------------------------------------------------------------------------- /base/java/oracle-jdk-1.8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | ENV JAVA_VERSION_MAJOR=8 \ 4 | JAVA_VERSION_MINOR=73 \ 5 | JAVA_VERSION_BUILD=02 \ 6 | JAVA_PACKAGE=server-jre \ 7 | GLIBC_PKG_VERSION=2.23-r1 \ 8 | LANG=en_US.UTF8 9 | 10 | WORKDIR /tmp 11 | 12 | RUN apk add --no-cache --update-cache curl ca-certificates bash && \ 13 | curl -Lo /etc/apk/keys/andyshinn.rsa.pub "https://github.com/andyshinn/alpine-pkg-glibc/releases/download/${GLIBC_PKG_VERSION}/andyshinn.rsa.pub" && \ 14 | curl -Lo glibc-${GLIBC_PKG_VERSION}.apk "https://github.com/andyshinn/alpine-pkg-glibc/releases/download/${GLIBC_PKG_VERSION}/glibc-${GLIBC_PKG_VERSION}.apk" && \ 15 | curl -Lo glibc-bin-${GLIBC_PKG_VERSION}.apk "https://github.com/andyshinn/alpine-pkg-glibc/releases/download/${GLIBC_PKG_VERSION}/glibc-bin-${GLIBC_PKG_VERSION}.apk" && \ 16 | curl -Lo glibc-i18n-${GLIBC_PKG_VERSION}.apk "https://github.com/andyshinn/alpine-pkg-glibc/releases/download/${GLIBC_PKG_VERSION}/glibc-i18n-${GLIBC_PKG_VERSION}.apk" && \ 17 | apk add glibc-${GLIBC_PKG_VERSION}.apk glibc-bin-${GLIBC_PKG_VERSION}.apk glibc-i18n-${GLIBC_PKG_VERSION}.apk && \ 18 | curl -jksSLH "Cookie: oraclelicense=accept-securebackup-cookie" \ 19 | "http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz" | gunzip -c - | tar -xf - && \ 20 | apk del curl ca-certificates && \ 21 | mv jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR}/jre /jre && \ 22 | rm /jre/bin/jjs && \ 23 | rm /jre/bin/keytool && \ 24 | rm /jre/bin/orbd && \ 25 | rm /jre/bin/pack200 && \ 26 | rm /jre/bin/policytool && \ 27 | rm /jre/bin/rmid && \ 28 | rm /jre/bin/rmiregistry && \ 29 | rm /jre/bin/servertool && \ 30 | rm /jre/bin/tnameserv && \ 31 | rm /jre/bin/unpack200 && \ 32 | rm /jre/lib/ext/nashorn.jar && \ 33 | rm /jre/lib/jfr.jar && \ 34 | rm -rf /jre/lib/jfr && \ 35 | rm -rf /jre/lib/oblique-fonts && \ 36 | rm -rf /tmp/* /var/cache/apk/* && \ 37 | echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf 38 | 39 | ENV JAVA_HOME=/jre 40 | ENV PATH=${PATH}:${JAVA_HOME}/bin 41 | -------------------------------------------------------------------------------- /base/java/oracle-jdk-1.8/README.md: -------------------------------------------------------------------------------- 1 | # Java 1.8 JRE Image 2 | 3 | ## Build 4 | 5 | ```sh 6 | docker build -t yourname/java:latest . 7 | ``` 8 | 9 | Push: 10 | 11 | ```sh 12 | docker push yourname/java 13 | ``` 14 | -------------------------------------------------------------------------------- /base/node/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \ 4 | && apk update && apk upgrade \ 5 | && apk add ca-certificates nodejs@edge \ 6 | && npm uninstall -g npm \ 7 | && rm -rf /var/cache/apk/* 8 | -------------------------------------------------------------------------------- /base/node/README.md: -------------------------------------------------------------------------------- 1 | ## Build 2 | 3 | **NOTE: Temporarily using [mhart/alpine-node](https://github.com/mhart/alpine-node) for v5 images until Alpine package updated.** 4 | 5 | ## mhart version 6 | 7 | ```sh 8 | docker build -t yourname/node:latest -f Dockerfile.mhart . 9 | ``` 10 | 11 | ## Normal version 12 | 13 | ```sh 14 | docker build -t yourname/node:latest . 15 | ``` 16 | 17 | ## Push 18 | 19 | ```sh 20 | docker push yourname/node 21 | ``` 22 | -------------------------------------------------------------------------------- /base/node/dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \ 3 | && apk update && apk upgrade \ 4 | && apk add ca-certificates git nodejs-dev@edge nodejs@edge \ 5 | && npm install -g npm \ 6 | && rm -rf /var/cache/apk/* 7 | -------------------------------------------------------------------------------- /base/node/dev/README.md: -------------------------------------------------------------------------------- 1 | This image is for building your dependencies. You should use 2 | zuolan/node to run them (smaller image). 3 | 4 | ## Build 5 | 6 | **NOTE: Temporarily using [mhart/alpine-node](https://github.com/mhart/alpine-node) for v5 images until Alpine package updated.** 7 | 8 | ```sh 9 | docker build -t yourname/node:dev -f Dockerfile.mhart . 10 | ``` 11 | 12 | or 13 | 14 | ```sh 15 | docker build -t yourname/node:dev -f Dockerfile . 16 | ``` 17 | 18 | ## Push 19 | 20 | ```sh 21 | docker push yourname/node 22 | ``` 23 | -------------------------------------------------------------------------------- /base/php/README.md: -------------------------------------------------------------------------------- 1 | Image on Docker Hub: https://hub.docker.com/r/zuolan/php 2 | 3 | ## Using 4 | 5 | ```sh 6 | docker run -it --rm yourname/php php -v 7 | ``` 8 | 9 | ## Build 10 | 11 | ```sh 12 | docker build -t yourname/php:latest . 13 | ``` 14 | 15 | ## Push 16 | 17 | ```sh 18 | docker push yourname/php 19 | ``` 20 | -------------------------------------------------------------------------------- /base/php/php5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN apk update && apk upgrade \ 3 | && apk add ca-certificates php5 php5-phar php5-json php5-openssl php5-curl \ 4 | && rm -rf /var/cache/apk/* 5 | -------------------------------------------------------------------------------- /base/php/php5/dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN apk update && apk upgrade \ 3 | && apk add ca-certificates curl php5-dev php5-phar php5-json php5-openssl php5-curl \ 4 | && curl -sS https://getcomposer.org/installer | php \ 5 | && mv composer.phar /usr/local/bin/composer \ 6 | && apk del curl && rm -rf /var/cache/apk/* 7 | -------------------------------------------------------------------------------- /base/php/php5/dev/README.md: -------------------------------------------------------------------------------- 1 | ## Using 2 | 3 | ```sh 4 | docker run -it --rm yourname/php:dev composer install 5 | ``` 6 | 7 | ## Build 8 | 9 | ```sh 10 | docker build -t yourname/php:dev . 11 | ``` 12 | 13 | ## Push 14 | 15 | ```sh 16 | docker push yourname/php 17 | ``` 18 | -------------------------------------------------------------------------------- /base/php/php7/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN echo '@testing http://nl.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories \ 4 | && apk update && apk upgrade \ 5 | && apk add ca-certificates php7@testing php7-openssl@testing php7-phar@testing php7-json@testing php7-curl@testing \ 6 | && rm -rf /var/cache/apk/* \ 7 | && ln -s /usr/bin/php7 /usr/bin/php 8 | -------------------------------------------------------------------------------- /base/php/php7/dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN apk update && apk upgrade \ 4 | && apk add ca-certificates curl php7-dev@testing \ 5 | && curl -sS https://getcomposer.org/installer | php \ 6 | && mv composer.phar /usr/local/bin/composer \ 7 | && apk del curl && rm -rf /var/cache/apk/* 8 | -------------------------------------------------------------------------------- /base/php/php7/dev/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Using 3 | 4 | ```sh 5 | docker run -it --rm iron/php:dev composer install 6 | ``` 7 | -------------------------------------------------------------------------------- /base/python/README.md: -------------------------------------------------------------------------------- 1 | Image on Docker Hub: https://hub.docker.com/r/zuolan/python 2 | -------------------------------------------------------------------------------- /base/python/python2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN apk update && apk upgrade \ 3 | && apk add ca-certificates python \ 4 | && rm -rf /var/cache/apk/* 5 | -------------------------------------------------------------------------------- /base/python/python2/README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Using 3 | 4 | ```sh 5 | docker run -it --rm yourname/python:2 python --version 6 | ``` 7 | 8 | ## Build 9 | 10 | ```sh 11 | docker build -t yourname/python:2 . 12 | ``` 13 | 14 | ## Push 15 | 16 | ```sh 17 | docker push yourname/python 18 | ``` 19 | -------------------------------------------------------------------------------- /base/python/python2/dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN apk update && apk upgrade \ 4 | && apk add curl ca-certificates python-dev \ 5 | && curl -sS https://bootstrap.pypa.io/get-pip.py | python \ 6 | && apk del curl && rm -rf /var/cache/apk/* 7 | -------------------------------------------------------------------------------- /base/python/python2/dev/README.md: -------------------------------------------------------------------------------- 1 | ## Using 2 | 3 | ```sh 4 | docker run -it --rm yourname/python python --version 5 | ``` 6 | 7 | ## Build 8 | 9 | ```sh 10 | docker build -t yourname/python:2-dev . 11 | ``` 12 | 13 | ## Push 14 | 15 | ```sh 16 | docker push yourname/python 17 | ``` 18 | -------------------------------------------------------------------------------- /base/python/python3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN apk update && apk upgrade \ 3 | && apk add ca-certificates python3 \ 4 | && rm -rf /var/cache/apk/* 5 | -------------------------------------------------------------------------------- /base/python/python3/README.md: -------------------------------------------------------------------------------- 1 | ## Using 2 | 3 | ```sh 4 | docker run -it --rm yourname/python3 python3 --version 5 | ``` 6 | 7 | ## Build 8 | 9 | ```sh 10 | docker build -t yourname/python:latest . 11 | ``` 12 | 13 | ## Push 14 | 15 | ```sh 16 | docker push yourname/python 17 | ``` 18 | -------------------------------------------------------------------------------- /base/python/python3/dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN apk update && apk upgrade \ 3 | && apk add ca-certificates curl python3-dev \ 4 | && curl -sS https://bootstrap.pypa.io/get-pip.py | python3 \ 5 | && apk del curl && rm -rf /var/cache/apk/* 6 | -------------------------------------------------------------------------------- /base/python/python3/dev/README.md: -------------------------------------------------------------------------------- 1 | ## Using 2 | 3 | ```sh 4 | docker run -it --rm yourname/python python --version 5 | ``` 6 | 7 | ## Build 8 | 9 | ```sh 10 | docker build -t yourname/python:dev . 11 | ``` 12 | 13 | ## Push 14 | 15 | ```sh 16 | docker push yourname/python 17 | ``` 18 | -------------------------------------------------------------------------------- /cloud9-ide/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:slim 2 | MAINTAINER izuolan 3 | 4 | RUN buildDeps='make build-essential g++ gcc python2.7' && softDeps="git" && \ 5 | apt-get update && apt-get upgrade -y && \ 6 | apt-get install -y $buildDeps $softDeps --no-install-recommends && \ 7 | yarn global add forever && \ 8 | git clone https://github.com/c9/core.git /cloud9 && cd /cloud9 && \ 9 | scripts/install-sdk.sh && \ 10 | git reset HEAD --hard && \ 11 | npm i -g npm && \ 12 | apt-get purge -y --auto-remove $buildDeps && \ 13 | apt-get autoremove -y && apt-get autoclean -y && apt-get clean -y && \ 14 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 15 | 16 | VOLUME /workspace 17 | EXPOSE 8181 18 | ENTRYPOINT ["forever", "/cloud9/server.js", "-w", "/workspace", "-l", "0.0.0.0"] 19 | # CMD["--auth","username:password"] 20 | -------------------------------------------------------------------------------- /cloud9-ide/Dockerfile.full: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | MAINTAINER ZuoLan 3 | 4 | RUN apt-get update && \ 5 | # Install dependencies 6 | apt-get -y install git curl build-essential supervisor && \ 7 | # Install nodejs 8 | curl -sL https://deb.nodesource.com/setup | sudo bash - && \ 9 | apt-get -y install nodejs && \ 10 | npm install -g foreve && \ 11 | # Install Cloud9 and Add workspace volumes 12 | git clone https://github.com/c9/core.git /cloud9 && cd /cloud9 && \ 13 | scripts/install-sdk.sh && \ 14 | # clean cache 15 | apt-get autoremove -y && \ 16 | apt-get autoclean -y && \ 17 | apt-get clean -y && \ 18 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 19 | npm cache clean 20 | 21 | VOLUME /workspace 22 | EXPOSE 8181 23 | ENTRYPOINT ["forever", "/cloud9/server.js", "-w", "/workspace", "-l", "0.0.0.0"] 24 | #CMD["--auth","username:password"] -------------------------------------------------------------------------------- /cloud9-ide/Dockerfile.swift: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | MAINTAINER ZuoLan 3 | 4 | ENV buildDeps="make build-essential g++ gcc curl ca-certificates git" \ 5 | c9Deps="nodejs" \ 6 | swiftDeps="curl python-dev libedit2 clang libicu52 libxml2" 7 | 8 | # If you use Swift package, may be need install libicu-dev, so you can use libicu-dev instead of libicu52. 9 | RUN apt-get update && apt-get upgrade -y && \ 10 | apt-get install -y $buildDeps --no-install-recommends && \ 11 | curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - && \ 12 | apt-get -y install $c9Deps $swiftDeps && \ 13 | npm install -g forever && npm cache clean && \ 14 | git clone https://github.com/c9/core.git /cloud9 && cd /cloud9 && \ 15 | scripts/install-sdk.sh && \ 16 | # Install Swift 17 | cd /usr/local/ && \ 18 | curl -o swift.tar.gz -sL https://swift.org/builds/swift-3.0-release/ubuntu1404/swift-3.0-RELEASE/swift-3.0-RELEASE-ubuntu14.04.tar.gz && \ 19 | tar xzf swift.tar.gz && mv swift-3.0-RELEASE-ubuntu14.04 swift && rm /usr/local/swift.tar.gz && \ 20 | echo 'export PATH=/usr/local/swift/usr/bin:"${PATH}"' >> ~/.bashrc && \ 21 | apt-get autoremove -y $buildDeps && \ 22 | apt-get autoremove -y && apt-get autoclean -y && apt-get clean -y && \ 23 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 24 | npm cache clean 25 | 26 | VOLUME /workspace 27 | EXPOSE 8181 28 | ENTRYPOINT ["forever", "/cloud9/server.js", "-w", "/workspace", "-l", "0.0.0.0"] 29 | #CMD["--auth","username:password"] -------------------------------------------------------------------------------- /cloud9-ide/Dockerfile.ubuntu: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | MAINTAINER ZuoLan 3 | 4 | RUN buildDeps='make build-essential g++ gcc python curl ca-certificates' && softDeps="nodejs git" && \ 5 | apt-get update && apt-get upgrade -y && \ 6 | apt-get install -y $buildDeps --no-install-recommends && \ 7 | curl -sL https://deb.nodesource.com/setup | sudo bash - && \ 8 | apt-get install -y $softDeps && \ 9 | npm install -g forever && npm cache clean && \ 10 | git clone https://github.com/c9/core.git /cloud9 && cd /cloud9 && \ 11 | scripts/install-sdk.sh && \ 12 | apt-get purge -y --auto-remove $buildDeps && \ 13 | apt-get autoremove -y && apt-get autoclean -y && apt-get clean -y && \ 14 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 15 | npm cache clean 16 | 17 | VOLUME /workspace 18 | EXPOSE 8181 19 | ENTRYPOINT ["forever", "/cloud9/server.js", "-w", "/workspace", "-l", "0.0.0.0"] 20 | #CMD["--auth","username:password"] -------------------------------------------------------------------------------- /cloud9-ide/README.md: -------------------------------------------------------------------------------- 1 | Cloud9 IDE Dockerfile 2 | ================ 3 | 4 | This repository contains Dockerfile of Cloud9 IDE with some usefull features for convenience and secure development environment for Docker's automated build published to the public Docker Hub Registry. 5 | 6 | ## features: 7 | - Auto protect the IDE with user defined (or default) password. 8 | - Custom container workspace directory (make it easier to link with VOLUME_FROM other container, not just host directory mapping). 9 | - Optimized build process (please suggest if any idea to make it better) 10 | 11 | ## Base Docker Image 12 | 13 | * ubuntu:latest 14 | 15 | ## Installation 16 | 17 | #### Basic Usage 18 | 19 | ``` 20 | docker run -dit --name=cloud9 \ 21 | -p 8181:8181 \ 22 | -v /yourpath/workspace/:/workspace \ 23 | zuolan/cloud9-ide --auth username:password 24 | ``` 25 | 26 | #### Image Tag 27 | 28 | * zuolan/cloud9-ide:latest -- Base on Debian, and minimize installation. 29 | * zuolan/cloud9-ide:ubuntu -- Base on Ubuntu, and minimize installation. 30 | * zuolan/cloud9-ide:full -- Base on ubuntu, and save build tools. 31 | * zuolan/cloud9-ide:swift -- Base on ubuntu, and installed Swift for Linux. 32 | 33 | #### Build and run your image 34 | 35 | Build latest image: 36 | ``` 37 | docker build -t yourname/cloud9-ide -f Dockerfile . 38 | ``` 39 | 40 | Build full image: 41 | ``` 42 | docker build -t yourname/cloud9-ide:full -f Dockerfile.full . 43 | ``` 44 | 45 | Build Ubuntu image: 46 | ``` 47 | docker build -t yourname/cloud9-ide:ubuntu -f Dockerfile.ubuntu . 48 | ``` 49 | 50 | Build Swift image: 51 | ``` 52 | docker build -t yourname/cloud9-ide:swift -f Dockerfile.swift . 53 | ``` 54 | 55 | Happy Coding !! 56 | 57 | ---- 58 | 59 | ## Contect Me 60 | No matter where I am, will be immediately received. 61 | My Email: `echo "aUB6dW9sYW4ubWUK" | base64 -d` -------------------------------------------------------------------------------- /cloudstack/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories && \ 4 | echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \ 5 | echo '@testing http://nl.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \ 6 | apk add --no-cache \ 7 | ca-certificates \ 8 | openjdk8@community \ 9 | # genisoimage \ 10 | libffi-dev \ 11 | openssl-dev \ 12 | git \ 13 | sudo \ 14 | bash \ 15 | # ipmitool \ 16 | maven \ 17 | python-dev \ 18 | py-setuptools \ 19 | py2-pip \ 20 | # python-mysql.connector \ 21 | supervisor \ 22 | py-mysqldb && \ 23 | # build-base musl-dev make gcc libffi && \ 24 | rm -rf /tmp/* /var/cache/apk/* 25 | 26 | COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf 27 | RUN git clone https://github.com/apache/cloudstack.git /root 28 | WORKDIR /root 29 | RUN mvn -Pdeveloper -Dsimulator -DskipTests -X -e clean install 30 | -------------------------------------------------------------------------------- /cloudstack/README.md: -------------------------------------------------------------------------------- 1 | ## Deprecated -------------------------------------------------------------------------------- /cloudstack/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:mysqld] 5 | command=/usr/bin/mysqld_safe 6 | autostart=true 7 | autorestart=true 8 | user=root 9 | 10 | [program:cloudstack] 11 | command=/bin/bash -c "mvn -pl client jetty:run -Dsimulator" 12 | directory=/root 13 | stdout_logfile=/dev/stdout 14 | stdout_logfile_maxbytes=0 15 | user=root 16 | -------------------------------------------------------------------------------- /compose/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.4 2 | 3 | RUN set -x && \ 4 | apk add --no-cache -t .deps ca-certificates curl && \ 5 | # Install glibc on Alpine (required by docker-compose) from 6 | # https://github.com/sgerrand/alpine-pkg-glibc 7 | # See also https://github.com/gliderlabs/docker-alpine/issues/11 8 | GLIBC_VERSION='2.23-r3' && \ 9 | curl -Lo /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub && \ 10 | curl -Lo glibc.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/$GLIBC_VERSION/glibc-$GLIBC_VERSION.apk && \ 11 | curl -Lo glibc-bin.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/$GLIBC_VERSION/glibc-bin-$GLIBC_VERSION.apk && \ 12 | apk update && \ 13 | apk add glibc.apk glibc-bin.apk && \ 14 | rm -rf /var/cache/apk/* glibc.apk glibkc-bin.apk && \ 15 | \ 16 | # Clean-up 17 | apk del .deps 18 | 19 | RUN set -x && \ 20 | apk add --no-cache -t .deps ca-certificates curl && \ 21 | # Install docker-compose 22 | # https://docs.docker.com/compose/install/ 23 | DOCKER_COMPOSE_URL=https://github.com$(curl -L https://github.com/docker/compose/releases/latest | grep -Eo 'href="[^"]+docker-compose-Linux-x86_64' | sed 's/^href="//') && \ 24 | curl -Lo /usr/local/bin/docker-compose $DOCKER_COMPOSE_URL && \ 25 | chmod a+rx /usr/local/bin/docker-compose && \ 26 | \ 27 | # Basic check it works 28 | docker-compose version && \ 29 | \ 30 | # Clean-up 31 | apk del .deps 32 | 33 | VOLUME /code 34 | WORKDIR /code 35 | 36 | ENTRYPOINT ["/usr/local/bin/docker-compose"] 37 | -------------------------------------------------------------------------------- /compose/README.md: -------------------------------------------------------------------------------- 1 | ## Usage 2 | Just Run. -------------------------------------------------------------------------------- /dog-tunnel/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | # 指明通道行为,服务器端默认不指定,客户端指定。 4 | ENV ACTION="" 5 | 6 | # 登录验证,服务端和客户端相同。 7 | ENV AUTH="yourpassword" 8 | 9 | # DNS 缓存时间(分钟),有加速效果。 10 | ENV DNSCACHE="10" 11 | 12 | # 客户端端口 13 | ENV LOCAL_PORT="1080" 14 | 15 | # 服务端端口 16 | ENV SERVER_PORT="9090" 17 | 18 | # TCP 模式(默认为UDP) 19 | ENV TCP="false" 20 | 21 | # 通道个数,默认1,最大100。 22 | ENV PIPE="10" 23 | 24 | # UDP 握手加密,服务端和客户端需一致。 25 | ENV XOR="secret" 26 | 27 | # 会话销毁 28 | ENV TIMEOUT="30" 29 | 30 | # Socks5 智能代理 31 | ENV SMARTN="3" 32 | 33 | RUN apk update && \ 34 | apk add git make go && \ 35 | git clone https://github.com/vzex/dog-tunnel.git /dog-tunnel && \ 36 | cd /dog-tunnel && \ 37 | git checkout origin/udpVersion -b udp && \ 38 | make client && \ 39 | cp dtunnel_lite /usr/bin && \ 40 | apk del run-parts openssl lua5.2-libs lua5.2 ncurses-terminfo ncurses-widec-libs lua5.2-posix ca-certificates libssh2 curl expat pcre git go make && \ 41 | apk cache clean && \ 42 | rm -rf /usr/lib/go && \ 43 | rm -rf /dog-tunnel; 44 | CMD ["/usr/bin/dtunnel_lite", "-service 0.0.0.0:${SERVER_PORT} -v -action ${ACTION} -xor ${XOR} -auth ${AUTH} -dnscache ${DNSCACHE}"] 45 | # CMD ["/usr/bin/dtunnel_lite", "-service 0.0.0.0:${SERVER_PORT} -local :${LOCAL_PORT} -v -action ${ACTION} -xor ${XOR} -auth ${AUTH} -encrypt -session_timeout ${TIMEOUT} -smartN ${SMARTN} -pipe ${PIPE}"] -------------------------------------------------------------------------------- /eclipse-che/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | MAINTAINER izuolan 3 | 4 | RUN apt-get update && \ 5 | apt-get -y install sudo procps wget unzip mc && \ 6 | echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ 7 | useradd -u 1000 -G users,sudo -d /home/user --shell /bin/bash -m user && \ 8 | echo "secret\nsecret" | passwd user && apt-get clean && \ 9 | sudo apt-get install -y -q git subversion apt-transport-https \ 10 | ca-certificates \ 11 | curl \ 12 | lxc \ 13 | iptables && \ 14 | apt-get clean all 15 | 16 | USER user 17 | 18 | RUN curl -sSL https://get.docker.com/ | sh && \ 19 | sudo usermod -aG docker user 20 | 21 | ENV CHE_VERSION="3.13.4.2" \ 22 | MAVEN_VERSION=3.2.2 \ 23 | JAVA_VERSION=8u45 \ 24 | JAVA_VERSION_PREFIX=1.8.0_45 \ 25 | CHE_LOCAL_CONF_DIR=/home/user/.che 26 | 27 | ENV JAVA_HOME=/opt/jdk$JAVA_VERSION_PREFIX \ 28 | M2_HOME=/opt/apache-maven-$MAVEN_VERSION 29 | 30 | ENV PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH 31 | 32 | RUN mkdir /home/user/che-$CHE_VERSION /home/user/che-projects && \ 33 | wget -q http://maven.codenvycorp.com/content/repositories/codenvy-public-releases/org/eclipse/che/ide/assembly-sdk/$CHE_VERSION/assembly-sdk-$CHE_VERSION.zip -P /home/user && \ 34 | unzip -q /home/user/assembly-sdk-$CHE_VERSION.zip -d /home/user && \ 35 | cp -a /home/user/assembly-sdk-$CHE_VERSION/. /home/user/che-$CHE_VERSION/ && \ 36 | rm /home/user/assembly-sdk-$CHE_VERSION.zip && \ 37 | rm -rf /home/user/assembly-sdk-$CHE_VERSION && \ 38 | wget \ 39 | --no-cookies \ 40 | --no-check-certificate \ 41 | --header "Cookie: oraclelicense=accept-securebackup-cookie" \ 42 | -qO- \ 43 | "http://download.oracle.com/otn-pub/java/jdk/$JAVA_VERSION-b14/jdk-$JAVA_VERSION-linux-x64.tar.gz" | sudo tar -zx -C /opt/ && \ 44 | echo "export JAVA_HOME=$JAVA_HOME" >> /home/user/.bashrc && \ 45 | sudo mkdir /opt/apache-maven-$MAVEN_VERSION/ && \ 46 | sudo wget -qO- "https://archive.apache.org/dist/maven/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" | sudo tar -zx --strip-components=1 -C /opt/apache-maven-$MAVEN_VERSION/ && \ 47 | echo "export M2_HOME=$M2_HOME" >> /home/user/.bashrc && \ 48 | mkdir -p /home/user/.che && \ 49 | echo "export PATH=$PATH" >> /home/user/.bashrc && \ 50 | cd /home/user/.che && \ 51 | touch vfs && \ 52 | echo "1q2w3e=/home/user/che-$CHE_VERSION/temp/fs-root" >> vfs && \ 53 | echo "export CHE_LOCAL_CONF_DIR=$CHE_LOCAL_CONF_DIR" >> /home/user/.bashrc && \ 54 | sudo chmod 757 -R /home/user/che-$CHE_VERSION && \ 55 | sudo chmod 757 -R /home/user/.che 56 | 57 | ADD che.properties /home/user/.che/che.properties 58 | ADD ./wrapdocker /usr/local/bin/wrapdocker 59 | RUN sudo chmod +x /usr/local/bin/wrapdocker 60 | WORKDIR /home/user/che-$CHE_VERSION/bin 61 | 62 | # expose 8080 port and a range of ports for runners 63 | EXPOSE 8080 8000 49152-49162 64 | CMD sudo wrapdocker & ./che.sh run 65 | -------------------------------------------------------------------------------- /eclipse-che/README.md: -------------------------------------------------------------------------------- 1 | #### How to run 2 | 3 | `docker run -i -t -p 8080:8080 -p 49152-49162:49152-49162 codenvy/che` 4 | 5 | Once started, Che will be available at [http://localhosts:8080](http://localhost:8080) 6 | 7 | #### More details 8 | 9 | [http://eclipseche.org/docs/install-using-docker](http://eclipseche.org/docs/install-using-docker) 10 | -------------------------------------------------------------------------------- /eclipse-che/che.properties: -------------------------------------------------------------------------------- 1 | opyright (c) 2012-2015 Codenvy, S.A. 2 | # All rights reserved. This program and the accompanying materials 3 | # are made available under the terms of the Eclipse Public License v1.0 4 | # which accompanies this distribution, and is available at 5 | # http://www.eclipse.org/legal/epl-v10.html 6 | # 7 | # Contributors: 8 | # Codenvy, S.A. - initial API and implementation 9 | # 10 | 11 | # URL path to api service 12 | api.endpoint=http://localhost:${SERVER_PORT}/che/api 13 | # range of available service ports 14 | sys.resources.min_port=49152 15 | sys.resources.max_port=49162 16 | 17 | # URL part to IDE WAR 18 | project.base_icon_url=http://localhost:${SERVER_PORT}/ws/_app/projecttype/ 19 | 20 | #builder 21 | #max time value during which builder is executing 22 | builder.max_execution_time=300 23 | #value of time during which builder is waiting in queue before stopping 24 | builder.waiting_time=600 25 | #directory in which builder will be deployed 26 | builder.base_directory=${catalina.base}/temp/builder 27 | #default builder workers number 28 | builder.workers_number=-1 29 | #value of time during which builder keeps result 30 | builder.keep_result_time=900 31 | #max value of builders which are in queue 32 | builder.queue_size=100 33 | 34 | # runner 35 | #total size of memory 36 | runner.total_apps_mem_size_mb=1024 37 | #default size of memory 38 | runner.default_app_mem_size=256 39 | #time during which runner is live 40 | runner.app_lifetime=3600 41 | #value of time during which runner is waiting in queue before stopping 42 | runner.waiting_time=600 43 | #directory in which runner will be deployed 44 | runner.deploy_directory=${catalina.base}/temp/runner 45 | runner.cleanup_time=60 46 | #default value of tomcat runner memory 47 | runner.tomcat.memory=256 48 | #home directory of tomcat's runner 49 | runner.tomcat.tomcat_home=${catalina.base}/tomcat 50 | 51 | # java web application 52 | runner.java_webapp.host_name=localhost 53 | # GWT code server domain name 54 | runner.sdk.code_server_bind_address=localhost 55 | #sdk host name 56 | runner.sdk.host_name=localhost 57 | # grunt runner 58 | runner.javascript_grunt.host_name=localhost 59 | # gulp runner 60 | runner.javascript_gulp.host_name=localhost 61 | # docker 62 | runner.docker.host_name=localhost 63 | runner.docker.application_link_template=http://localhost:%d 64 | runner.docker.web_shell_link_template=http://localhost:%d 65 | runner.docker.watch_update_project_types=AngularJS,php,ruby,python,GAEPython,GAEPhp,GruntJS,GulpJS,BasicJS,cpp,blank 66 | runner.docker.dockerfiles_repo=${catalina.base}/recipes 67 | # extensions 68 | extension-url=${catalina.base}/tutorials 69 | tutorials-url=${catalina.base}/tutorials 70 | 71 | # vfs 72 | #local workspace id 73 | vfs.local.id=1q2w3e 74 | #local workspace root dir 75 | vfs.local.fs_root_dir=${catalina.base}/temp/fs-root 76 | #local workspace indexes root dir 77 | vfs.local.fs_index_root_dir=${catalina.base}/temp/indexes 78 | #local temporary workspace root dir 79 | vfs.local.tmp_workspace_fs_root_dir=${catalina.base}/temp/tmp-ws-fs-root 80 | # local mapping file dir 81 | vfs.local.directory_mapping_file=/home/user/.che/vfs 82 | #default github user name 83 | github.user=codenvy 84 | #vendor 85 | github.vendorOAuthScopes=repo, user, write:public_key 86 | # everrest.async 87 | # Disable asynchronous mechanism that is embedded in everrest. Codenvy has own mechanism for that. 88 | org.everrest.asynchronous=false 89 | #quantity of asynchronous requests which may be processed at the same time 90 | org.everrest.asynchronous.pool.size=20 91 | #Size of queue. If asynchronous request can't be processed after consuming it will be added in queue. 92 | org.everrest.asynchronous.queue.size=500 93 | #Timeout in minutes for request. If after timeout request is not done or client did not come yet to get result of request it may be discarded. 94 | org.everrest.asynchronous.job.timeout=10 95 | #Size of cache for waiting, running and ended request. 96 | org.everrest.asynchronous.cache.size=1024 97 | #path to asynchronous service 98 | org.everrest.asynchronous.service.path=/async/ 99 | 100 | #security 101 | #GitHub application Client ID 102 | oauth.github.clientid=7c8b24255a417bfeb03d 103 | #GitHub application secret 104 | oauth.github.clientsecret=fb8d543f5fea1de5d99fd0ad435a62ff7f0dba41 105 | #auth uri 106 | oauth.github.authuri= https://github.com/login/oauth/authorize 107 | #token uri 108 | oauth.github.tokenuri= https://github.com/login/oauth/access_token 109 | #redirected uris 110 | oauth.github.redirecturis= http://localhost:${SERVER_PORT}/che/api/oauth/callback 111 | 112 | # MUST be renamed in security project, it is URL of oauth error page 113 | auth.sso.login_page_url=/error 114 | #identifier of access denied error page 115 | auth.oauth.access_denied_error_page=/error-oauth 116 | oauth.wso2.useruri= 117 | 118 | #Git OAuth Credentials Provider Configuration 119 | oauth.wso2.git.pattern=(http|https)://((([0-9a-fA-F]{32}(:x-oauth-basic)?)|([0-9a-zA-Z-_.]+))@)?git\\.cloudpreview\\.wso2\\.com(:[0-9]{1,5})?/.+\\.git 120 | 121 | # preferences and profile settings 122 | user.local.db=/home/user/.che 123 | # storage path for models from local dao implementations 124 | local.storage.path=/home/user/.che 125 | 126 | # path to templates' description folder 127 | project.template_descriptions_dir=${catalina.base}/che-templates 128 | # path to templates' location 129 | project.template_location_dir=${catalina.base}/che-templates 130 | 131 | #path to service to slave runner 132 | runner.slave_runner_urls=http://localhost:${SERVER_PORT}/che/api/internal/runner 133 | #path to service to slave builder 134 | builder.slave_builder_urls=http://localhost:${SERVER_PORT}/che/api/internal/builder 135 | 136 | #change enabling of subscription orgaddon 137 | subscription.orgaddon.enabled=true 138 | #initial thread pool size for scheduled tasks 139 | schedule.core_pool_size=10 140 | 141 | che.java.codeassistant.index.dir=${java.io.tmpdir} 142 | git.server.uri.prefix=git 143 | -------------------------------------------------------------------------------- /eclipse-che/wrapdocker: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Ensure that all nodes in /dev/mapper correspond to mapped devices currently loaded by the device-mapper kernel driver 4 | dmsetup mknodes 5 | 6 | # First, make sure that cgroups are mounted correctly. 7 | CGROUP=/sys/fs/cgroup 8 | : {LOG:=stdio} 9 | 10 | [ -d $CGROUP ] || 11 | mkdir $CGROUP 12 | 13 | mountpoint -q $CGROUP >> /dev/null || 14 | mount -n -t tmpfs -o uid=0,gid=0,mode=0755 cgroup $CGROUP >> /dev/null || { 15 | echo "Could not make a tmpfs mount. Did you use --privileged?" 16 | exit 1 17 | } 18 | 19 | if [ -d /sys/kernel/security ] && ! mountpoint -q /sys/kernel/security 20 | then 21 | mount -t securityfs none /sys/kernel/security >> /dev/null || { 22 | echo "Could not mount /sys/kernel/security." 23 | echo "AppArmor detection and --privileged mode might break." 24 | } 25 | fi 26 | 27 | # Mount the cgroup hierarchies exactly as they are in the parent system. 28 | for SUBSYS in $(cut -d: -f2 /proc/1/cgroup) 29 | do 30 | [ -d $CGROUP/$SUBSYS ] || mkdir $CGROUP/$SUBSYS 31 | mountpoint -q $CGROUP/$SUBSYS >> /dev/null || 32 | mount -n -t cgroup -o $SUBSYS cgroup $CGROUP/$SUBSYS >> /dev/null 33 | 34 | # The two following sections address a bug which manifests itself 35 | # by a cryptic "lxc-start: no ns_cgroup option specified" when 36 | # trying to start containers withina container. 37 | # The bug seems to appear when the cgroup hierarchies are not 38 | # mounted on the exact same directories in the host, and in the 39 | # container. 40 | 41 | # Named, control-less cgroups are mounted with "-o name=foo" 42 | # (and appear as such under /proc//cgroup) but are usually 43 | # mounted on a directory named "foo" (without the "name=" prefix). 44 | # Systemd and OpenRC (and possibly others) both create such a 45 | # cgroup. To avoid the aforementioned bug, we symlink "foo" to 46 | # "name=foo". This shouldn't have any adverse effect. 47 | echo $SUBSYS | grep -q ^name= && { 48 | NAME=$(echo $SUBSYS | sed s/^name=//) 49 | #ln -s $SUBSYS $CGROUP/$NAME >> /dev/null 50 | } 51 | 52 | # Likewise, on at least one system, it has been reported that 53 | # systemd would mount the CPU and CPU accounting controllers 54 | # (respectively "cpu" and "cpuacct") with "-o cpuacct,cpu" 55 | # but on a directory called "cpu,cpuacct" (note the inversion 56 | # in the order of the groups). This tries to work around it. 57 | [ $SUBSYS = cpuacct,cpu ] && ln -s $SUBSYS $CGROUP/cpu,cpuacct 58 | done 59 | 60 | # Note: as I write those lines, the LXC userland tools cannot setup 61 | # a "sub-container" properly if the "devices" cgroup is not in its 62 | # own hierarchy. Let's detect this and issue a warning. 63 | grep -q :devices: /proc/1/cgroup || 64 | echo "WARNING: the 'devices' cgroup should be in its own hierarchy." 65 | grep -qw devices /proc/1/cgroup || 66 | echo "WARNING: it looks like the 'devices' cgroup is not mounted." 67 | 68 | # Now, close extraneous file descriptors. 69 | pushd /proc/self/fd >/dev/null 70 | for FD in * 71 | do 72 | case "$FD" in 73 | # Keep stdin/stdout/stderr 74 | [012]) 75 | ;; 76 | # Nuke everything else 77 | *) 78 | eval exec "$FD>&-" >> /dev/null 79 | ;; 80 | esac 81 | done 82 | popd >/dev/null 83 | 84 | 85 | # If a pidfile is still around (for example after a container restart), 86 | # delete it so that docker can start. 87 | rm -rf /var/run/docker.pid 88 | 89 | # If we were given a PORT environment variable, start as a simple daemon; 90 | # otherwise, spawn a shell as well 91 | if [ "$PORT" ] 92 | then 93 | exec docker daemon --log-level=error -H 0.0.0.0:$PORT -H unix:///var/run/docker.sock >> /dev/null \ 94 | $DOCKER_DAEMON_ARGS 95 | else 96 | if [ "$LOG" == "file" ] 97 | then 98 | docker daemon $DOCKER_DAEMON_ARGS &>/var/log/docker.log & 99 | else 100 | docker daemon --log-level=error $DOCKER_DAEMON_ARGS >> /dev/null & 101 | fi 102 | (( timeout = 60 + SECONDS )) 103 | until docker info >/dev/null 2>&1 104 | do 105 | if (( SECONDS >= timeout )); then 106 | echo 'Timed out trying to connect to internal docker host.' >&2 107 | break 108 | fi 109 | sleep 1 110 | done 111 | [[ $1 ]] && exec "$@" >> /dev/null 112 | exec bash --login >> /dev/null 113 | fi 114 | -------------------------------------------------------------------------------- /firefox/Dockerfile: -------------------------------------------------------------------------------- 1 | # Firefox over VNC 2 | # 3 | # VERSION 0.3 4 | 5 | FROM ubuntu 6 | 7 | # Install vnc, xvfb in order to create a 'fake' display and firefox 8 | RUN apt-get update && apt-get install -y x11vnc xvfb firefox 9 | RUN mkdir ~/.vnc 10 | # Setup a password 11 | RUN x11vnc -storepasswd 1234 ~/.vnc/passwd 12 | # Autostart firefox (might not be the best way, but it does the trick) 13 | RUN bash -c 'echo "firefox" >> /.bashrc' 14 | 15 | EXPOSE 5900 16 | CMD ["x11vnc", "-forever", "-usepw", "-create"] 17 | -------------------------------------------------------------------------------- /ghost-buster/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Umputun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ghost-buster/README.md: -------------------------------------------------------------------------------- 1 | # ghost-buster-docker 2 | Ready to use ghost with buster and auto-generation in docker container 3 | 4 | * [Ghost](https://ghost.org) is a simple, powerful publishing platform that allows you to share your stories with the world. 5 | * [Buster](https://github.com/axitkhurana/buster) is a brute force static site generator for Ghost. 6 | 7 | All of this in one ready to use container with ability to create backups automatically, save md files and (optionally) publish static blogs to external places, like S3. 8 | 9 | ### How to use: 10 | 11 | 1. pull repo from github: `git clone https://github.com/umputun/ghost-buster-docker.git` 12 | 1. make sure you have [docker-compose](https://docs.docker.com/compose/install/) installed 13 | 1. edit docker-compose.yml with your own domain 14 | 1. start it with `docker-compose up -d` 15 | 16 | ### What will it do? 17 | 18 | 1. run ghost on port 2368 19 | 1. run nginx proxy on port 80 20 | 1. watch for changes and generate static content in `static` 21 | 1. nginx will proxy all request to this `static`, except request to /ghost (admin interface) 22 | 23 | 24 | _Automated build on docker-hub: [umputun/ghost-buster-docker](https://hub.docker.com/r/umputun/ghost-buster-docker/)_ 25 | -------------------------------------------------------------------------------- /ghost-buster/build/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:0.12 2 | 3 | RUN apt-get update && \ 4 | apt-get install unzip python-setuptools python-dev libxml2-dev libxslt-dev -yq && \ 5 | easy_install pip 6 | 7 | # Install Ghost 8 | ENV GHOST_VERSION 0.8.0 9 | RUN cd /tmp && \ 10 | curl -sSL "https://ghost.org/archives/ghost-${GHOST_VERSION}.zip" -o ghost.zip && \ 11 | unzip ghost.zip -d /ghost && \ 12 | rm -f ghost.zip 13 | 14 | RUN cd /ghost && \ 15 | npm cache clean && \ 16 | npm install --production -d 17 | 18 | RUN sed 's/127.0.0.1/0.0.0.0/' /ghost/config.example.js > /ghost/config.js && \ 19 | useradd ghost --home /ghost 20 | 21 | # Install Buster 22 | RUN pip install buster 23 | 24 | # Install Inotify 25 | RUN apt-get install inotify-tools -y 26 | 27 | # Install MD Exporter 28 | RUN cd / ghost && \ 29 | npm install -g ghost-export 30 | 31 | # Clean cache 32 | RUN apt-get autoremove unzip python-setuptools -y && \ 33 | apt-get autoremove -y && \ 34 | apt-get autoclean -y && \ 35 | apt-get clean -y && \ 36 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 37 | npm cache clean 38 | 39 | ADD start.bash /ghost-start 40 | ADD publish.sh /ghost/publish.sh 41 | RUN chmod +x /ghost/publish.sh 42 | 43 | ENV NODE_ENV production 44 | 45 | VOLUME ["/ghost/static", "/export.md", "/ghost-override"] 46 | 47 | WORKDIR /ghost 48 | 49 | EXPOSE 2368 50 | 51 | CMD ["bash", "/ghost-start"] 52 | -------------------------------------------------------------------------------- /ghost-buster/build/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "building static site" 3 | buster generate 4 | echo "export md" 5 | ghost-export /ghost /export.md 6 | 7 | # workarounds for buster's issues 8 | sed -i -e 's|/index.html#disqus_thread|/#disqus_thread|g' /ghost/static/index.html 9 | find /ghost/static/tag -name index.html | xargs sed -i -e 's|/index.html#disqus_thread|/#disqus_thread|g' 10 | curl http://127.0.0.1:2368/rss/ > /ghost/static/rss 11 | curl http://127.0.0.1:2368/rss/ > /ghost/static/rss.xml 12 | 13 | echo "publishing ..." 14 | #copy from static/* to external desitnation 15 | -------------------------------------------------------------------------------- /ghost-buster/build/start.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | GHOST="/ghost" 4 | OVERRIDE="/ghost-override" 5 | 6 | CONFIG="config.js" 7 | DATA="content/data" 8 | IMAGES="content/images" 9 | THEMES="content/themes" 10 | 11 | cd "$GHOST" 12 | 13 | # Symlink data directory. 14 | mkdir -p "$OVERRIDE/$DATA" 15 | rm -fr "$DATA" 16 | ln -s "$OVERRIDE/$DATA" "content" 17 | 18 | # Symlink images directory 19 | mkdir -p "$OVERRIDE/$IMAGES" 20 | rm -fr "$IMAGES" 21 | ln -s "$OVERRIDE/$IMAGES" "$IMAGES" 22 | 23 | # Symlink config file. 24 | if [[ -f "$OVERRIDE/$CONFIG" ]]; then 25 | rm -f "$CONFIG" 26 | ln -s "$OVERRIDE/$CONFIG" "$CONFIG" 27 | fi 28 | 29 | # Symlink themes. 30 | if [[ -d "$OVERRIDE/$THEMES" ]]; then 31 | for theme in $(find "$OVERRIDE/$THEMES" -mindepth 1 -maxdepth 1 -type d -exec basename {} \;) 32 | do 33 | rm -fr "$THEMES/$theme" 34 | ln -s "$OVERRIDE/$THEMES/$theme" "$THEMES/$theme" 35 | done 36 | fi 37 | 38 | sed -i -e "s|http://my-ghost-blog.com|${BLOG_DOMAIN}|g" /ghost/config.js 39 | 40 | #start background watcher for buster 41 | while inotifywait -e modify /ghost/content/data/ghost.db; do sleep 10 && /ghost/publish.sh; done & 42 | 43 | # Start Ghost 44 | chown -R ghost:ghost /data /ghost /ghost-override 45 | su ghost << EOF 46 | cd "$GHOST" 47 | NODE_ENV=${NODE_ENV:-production} npm start 48 | EOF 49 | -------------------------------------------------------------------------------- /ghost-buster/docker-compose.yml: -------------------------------------------------------------------------------- 1 | ghost-buster: 2 | image: zuolan/ghost-buster 3 | restart: always 4 | container_name: ghost-buster 5 | environment: 6 | - BLOG_DOMAIN=https://zuolan.me #<<-- EDIT THIS 7 | - NODE_ENV=production 8 | ports: 9 | - "2368:2368" 10 | volumes: 11 | - ./static:/ghost/static 12 | - ./ghost-data:/ghost-override 13 | - ./export.md:/export.md 14 | caddy: 15 | image: abiosoft/caddy 16 | restart: always 17 | container_name: ghost-caddy 18 | links: 19 | - ghost-buster:ghost-buster 20 | ports: 21 | - "9000:2015" 22 | volumes: 23 | - ./static:/srv 24 | 25 | -------------------------------------------------------------------------------- /ghost-buster/setup-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "get and install docker-compose" 4 | curl -L https://github.com/docker/compose/releases/download/1.4.0/docker-compose-`uname -s`-`uname -m` > /tmp/docker-compose 5 | chmod +x /tmp/docker-compose 6 | sudo mv -f /tmp/docker-compose /usr/local/bin/docker-compose 7 | 8 | echo "edit params" 9 | nano docker-compose.yml 10 | 11 | echo "start ghost and nginx" 12 | docker-compose up -d 13 | 14 | echo "all done" 15 | -------------------------------------------------------------------------------- /glusterfs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y python-software-properties software-properties-common && \ 5 | add-apt-repository -y ppa:gluster/glusterfs-3.10 && \ 6 | apt-get update && \ 7 | apt-get install -y supervisor glusterfs-server && \ 8 | apt-get autoremove -y python-software-properties software-properties-common && \ 9 | apt-get autoclean && \ 10 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 11 | -------------------------------------------------------------------------------- /glusterfs/Dockerfile.client: -------------------------------------------------------------------------------- 1 | FROM zuolan/glusterfs 2 | 3 | ENV GLUSTER_VOL_NAME vol 4 | ENV GLUSTER_VOL_PATH /volume 5 | ENV GLUSTER_PEER **ChangeMe** 6 | ENV DEBUG 0 7 | 8 | COPY client/run.sh /run.sh 9 | COPY client/supervisord.conf /etc/supervisor/conf.d/supervisord.conf 10 | RUN chmod +x /run.sh 11 | WORKDIR ${GLUSTER_VOL_PATH} 12 | VOLUME ["${GLUSTER_VOL_PATH}"] 13 | 14 | CMD ["/run.sh"] 15 | -------------------------------------------------------------------------------- /glusterfs/Dockerfile.server: -------------------------------------------------------------------------------- 1 | FROM zuolan/glusterfs 2 | 3 | ENV GLUSTER_VOL_NAME vol 4 | ENV GLUSTER_REPLICA 2 5 | ENV GLUSTER_BRICK_PATH /volume 6 | ENV GLUSTER_PEER **ChangeMe** 7 | ENV SERVER_IP **ChangeMe** 8 | ENV DEBUG 0 9 | 10 | COPY server/run.sh /run.sh 11 | COPY server/supervisord.conf /etc/supervisor/conf.d/supervisord.conf 12 | RUN chmod +x /run.sh 13 | VOLUME ["$GLUSTER_BRICK_PATH"] 14 | 15 | CMD ["/run.sh"] 16 | -------------------------------------------------------------------------------- /glusterfs/client/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | [ "$DEBUG" == "1" ] && set -x && set +e 6 | 7 | /etc/init.d/glusterfs-server start 8 | sleep 5 9 | 10 | if [ "${GLUSTER_PEER}" == "**ChangeMe**" ]; then 11 | echo "ERROR: You did not specify "GLUSTER_PEER" environment variable - Exiting..." 12 | exit 0 13 | fi 14 | 15 | ALIVE=0 16 | for PEER in `echo "${GLUSTER_PEER}" | sed "s/,/ /g"`; do 17 | echo "=> Checking if I can reach GlusterFS node ${PEER} ..." 18 | if ping -c 10 ${PEER} >/dev/null 2>&1; then 19 | echo "=> GlusterFS node ${PEER} is alive" 20 | ALIVE=1 21 | break 22 | else 23 | echo "*** Could not reach server ${PEER} ..." 24 | fi 25 | done 26 | 27 | if [ "$ALIVE" == 0 ]; then 28 | echo "ERROR: could not contact any GlusterFS node from this list: ${GLUSTER_PEER} - Exiting..." 29 | exit 1 30 | fi 31 | 32 | echo "=> Mounting GlusterFS volume ${GLUSTER_VOL_NAME} from GlusterFS node ${PEER} ..." 33 | mount -t glusterfs ${PEER}:/${GLUSTER_VOL_NAME} ${GLUSTER_VOL_PATH} 34 | 35 | # public_ip=`dig -4 @ns1.google.com -t txt o-o.myaddr.l.google.com +short | sed "s/\"//g"` 36 | 37 | /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf 38 | -------------------------------------------------------------------------------- /glusterfs/client/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | -------------------------------------------------------------------------------- /glusterfs/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | server: 4 | container_name: server 5 | image: zuolan/glusterfs:server 6 | volumes: 7 | - "~/server_data:/volume" 8 | restart: always 9 | environment: 10 | GLUSTER_PEER: 172.17.0.8 11 | SERVER_IP: 172.17.0.7 12 | network_mode: host 13 | client: 14 | container_name: client 15 | image: zuolan/glusterfs:client 16 | volumes: 17 | - "~/client_data:/volume" 18 | depends_on: 19 | - server 20 | restart: always 21 | environment: 22 | GLUSTER_PEER: 172.17.0.7 23 | network_mode: host 24 | -------------------------------------------------------------------------------- /glusterfs/server/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ "$DEBUG" == "1" ] && set -x 4 | 5 | /etc/init.d/glusterfs-server start 6 | 7 | if [ "${GLUSTER_PEER}" == "**ChangeMe**" ]; then 8 | # This node is not connecting to the cluster yet 9 | exit 0 10 | fi 11 | 12 | echo "=> Waiting for glusterd to start..." 13 | sleep 5 14 | 15 | if gluster peer status | grep ${GLUSTER_PEER} >/dev/null; then 16 | echo "=> This peer is already part of Gluster Cluster, nothing to do..." 17 | exit 0 18 | fi 19 | 20 | echo "=> Probing peer ${GLUSTER_PEER}..." 21 | gluster peer probe ${GLUSTER_PEER} 22 | 23 | echo "=> Creating GlusterFS volume ${GLUSTER_VOL_NAME}..." 24 | gluster volume create ${GLUSTER_VOL_NAME} replica ${GLUSTER_REPLICA} ${SERVER_IP}:${GLUSTER_BRICK_PATH} ${GLUSTER_PEER}:${GLUSTER_BRICK_PATH} force 25 | 26 | echo "=> Starting GlusterFS volume ${GLUSTER_VOL_NAME}..." 27 | gluster volume start ${GLUSTER_VOL_NAME} 28 | 29 | /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf 30 | -------------------------------------------------------------------------------- /glusterfs/server/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | -------------------------------------------------------------------------------- /grav/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM abiosoft/caddy:php 2 | MAINTAINER Zuo Lan 3 | RUN apk update && \ 4 | apk add --no-cache \ 5 | php7-fpm php7-json php7-zlib php7-xml php7-pdo php7-phar php7-openssl \ 6 | php7-gd php7-iconv php7-mcrypt php7-session php7-zip \ 7 | php7-curl php7-opcache php7-ctype php7-apcu \ 8 | php7-intl php7-bcmath php7-dom php7-mbstring php7-xmlreader && \ 9 | rm -rf /var/cache/apk/* 10 | -------------------------------------------------------------------------------- /grav/Dockerfile.old: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | MAINTAINER Zuo Lan 3 | ENV TERM="xterm" \ 4 | GRAV_VERSION="1.1.15" 5 | 6 | RUN apk update && \ 7 | apk add --no-cache \ 8 | bash less vim git tzdata curl yaml zip \ 9 | nginx ca-certificates \ 10 | php7-fpm php7-json php7-zlib php7-xml php7-pdo php7-phar php7-openssl \ 11 | php7-gd php7-iconv php7-mcrypt php7-session php7-zip \ 12 | php7-curl php7-opcache php7-ctype php7-apcu \ 13 | php7-intl php7-bcmath php7-dom php7-mbstring php7-xmlreader && \ 14 | apk add -u musl && \ 15 | rm -rf /var/cache/apk/* 16 | 17 | RUN sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php7/php.ini && \ 18 | sed -i 's/expose_php = On/expose_php = Off/g' /etc/php7/php.ini && \ 19 | sed -i "s/nginx:x:100:101:nginx:\/var\/lib\/nginx:\/sbin\/nologin/nginx:x:100:101:nginx:\/usr:\/bin\/bash/g" /etc/passwd && \ 20 | sed -i "s/nginx:x:100:101:nginx:\/var\/lib\/nginx:\/sbin\/nologin/nginx:x:100:101:nginx:\/usr:\/bin\/bash/g" /etc/passwd- && \ 21 | ln -s /usr/bin/php7 /usr/bin/php && \ 22 | ln -s /sbin/php-fpm7 /sbin/php-fpm 23 | 24 | COPY files/nginx.conf /etc/nginx/ 25 | COPY files/php-fpm.conf /etc/php7/ 26 | COPY files/run.sh / 27 | RUN chmod +x /run.sh 28 | 29 | 30 | EXPOSE 80 31 | VOLUME ["/usr"] 32 | CMD ["/run.sh"] 33 | -------------------------------------------------------------------------------- /grav/files/nginx.conf: -------------------------------------------------------------------------------- 1 | daemon off; 2 | error_log stderr notice; 3 | pid /var/run/nginx.pid; 4 | env DB_HOST; 5 | env DB_NAME; 6 | env DB_USER; 7 | env DB_PASS; 8 | worker_processes 1; 9 | events { 10 | worker_connections 1024; 11 | } 12 | http { 13 | sendfile on; 14 | include /etc/nginx/mime.types; 15 | include /etc/nginx/fastcgi.conf; 16 | default_type application/octet-stream; 17 | access_log stdout; 18 | tcp_nopush on; 19 | client_body_temp_path /tmp/nginx/body 1 2; 20 | fastcgi_temp_path /tmp/nginx/fastcgi_temp 1 2; 21 | log_format blocked '$time_local: Blocked request from $http_x_real_ip $request'; 22 | log_format specialLog '$http_x_real_ip - $remote_user [$time_local] ' 23 | '"$request" $status $body_bytes_sent ' 24 | '"$http_referer" "$http_user_agent"'; 25 | client_max_body_size 512M; 26 | server { 27 | listen 80; 28 | root /usr/html; 29 | index index.php index.html index.htm; 30 | access_log stdout; 31 | error_log stderr notice; 32 | disable_symlinks off; 33 | location = /robots.txt { 34 | allow all; 35 | log_not_found off; 36 | access_log off; 37 | } 38 | location / { 39 | try_files $uri $uri/ /index.php?_url=$uri&$query_string; 40 | } 41 | 42 | location ~ [^/]\.php(/|$) { 43 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 44 | if (!-f $document_root$fastcgi_script_name) { 45 | return 404; 46 | } 47 | fastcgi_pass unix:/var/run/php7-fpm.sock; 48 | fastcgi_index index.php; 49 | fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; 50 | include fastcgi_params; 51 | } 52 | ## Block common exploits 53 | location ~* (<|%3C).*script.*(>|%3E) { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 54 | location ~* base64_(en|de)code\(.*\) { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 55 | location ~* (%24&x) { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 56 | location ~* (%0|%A|%B|%C|%D|%E|%F|127\.0) { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 57 | location ~* \.\.\/ { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 58 | location ~* ~$ { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 59 | location ~* proc/self/environ { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 60 | location ~* /\.(htaccess|htpasswd|svn) { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 61 | location ~* [a-zA-Z0-9_]=(\.\.//?)+ { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 62 | location ~* [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ { access_log /usr/logs/nginx/blocked.log blocked; deny all; } 63 | location ~* /(.git|cache|bin|logs|backup|tests)/.*$ { return 403; } 64 | location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } 65 | location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } 66 | location ~ /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /grav/files/php-fpm.conf: -------------------------------------------------------------------------------- 1 | error_log = /usr/logs/php-fpm/php-fpm.log 2 | log_level = warning 3 | [www] 4 | user = root 5 | group = root 6 | listen = /var/run/php7-fpm.sock 7 | listen.owner = root 8 | listen.group = root 9 | pm = ondemand 10 | ; Total RAM dedicated to the web server / Max child process size 11 | pm.max_children = 75 12 | pm.process_idle_timeout = 10s 13 | pm.max_requests = 500 14 | chdir = /usr/html 15 | php_flag[display_errors] = on 16 | php_admin_value[memory_limit] = 128M 17 | php_admin_value[upload_max_filesize] = 32M 18 | php_admin_value[post_max_size] = 32M 19 | php_admin_value[output_buffering] = 0 20 | php_admin_value[openssl.cafile] = /etc/ssl/certs/ca-certificates.crt 21 | php_admin_value[openssl.capath] = /etc/ssl/certs 22 | php_admin_value[max_input_nesting_level] = 256 23 | php_admin_value[max_input_vars] = 10000 24 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 25 | ; stderr will be redirected to /dev/null according to FastCGI specs. 26 | ; Default Value: no 27 | catch_workers_output = yes 28 | ; Database variables passed via -e argument on Docker 29 | env["DB_HOST"] = "$DB_HOST" 30 | env["DB_USER"] = "$DB_USER" 31 | env["DB_PASS"] = "$DB_PASS" 32 | env["DB_NAME"] = "$DB_NAME" 33 | -------------------------------------------------------------------------------- /grav/files/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | 3 | [ -f /run-pre.sh ] && /run-pre.sh 4 | 5 | if [ ! -d /usr/html ] ; then 6 | mkdir -p /usr/html 7 | chown -R root:root /usr/html 8 | else 9 | chown -R root:root /usr/html 10 | fi 11 | 12 | if [ ! -d /usr/html/system ] ; then 13 | curl -fLk -o /tmp/grav.zip "https://github.com/getgrav/grav/releases/download/$GRAV_VERSION/grav-admin-v$GRAV_VERSION.zip" 14 | mkdir /tmp/grav-src 15 | unzip /tmp/grav.zip -d /tmp/grav-src 16 | mv -f /tmp/grav-src/grav-admin/* /usr/html/ 17 | rm -R /tmp/grav* 18 | chown -R root:root /usr/html 19 | else 20 | chown -R root:root /usr/html 21 | fi 22 | 23 | chown -R root:root /usr/html 24 | 25 | find /usr/html -type f | xargs chmod 664 26 | find /usr/html -type d | xargs chmod 775 27 | find /usr/html -type d | xargs chmod +s 28 | 29 | # start php-fpm 30 | mkdir -p /usr/logs/php-fpm 31 | php-fpm7 -R 32 | 33 | # start nginx 34 | mkdir -p /usr/logs/nginx 35 | mkdir -p /tmp/nginx 36 | chown nginx /tmp/nginx 37 | nginx 38 | -------------------------------------------------------------------------------- /hackpad/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | RUN apt-get -y update 4 | 5 | RUN apt-get install -yf \ 6 | openjdk-7-jdk \ 7 | mysql-server \ 8 | scala 9 | 10 | RUN mkdir /etc/hackpad 11 | 12 | VOLUME /etc/hackpad/src 13 | 14 | COPY docker-entrypoint.sh /etc/hackpad/ 15 | 16 | ENTRYPOINT ["/etc/hackpad/docker-entrypoint.sh"] 17 | 18 | EXPOSE 9000 19 | 20 | CMD ["hackpad"] 21 | -------------------------------------------------------------------------------- /hackpad/README.md: -------------------------------------------------------------------------------- 1 | How to develop Hackpad under Docker 2 | =================================== 3 | 4 | If you'd like to develop Hackpad on Docker, these instructions are for you. 5 | 6 | This will let you edit this repository and see your changes reflected in the docker image. 7 | 8 | Getting it running 9 | ------------------- 10 | 11 | 1. Obviously, if you haven't already, you'll need to install [Docker](https://docs.docker.com/installation/). 12 | 13 | 2. Build the image. From the root of this repo, run: 14 | 15 | docker build -t hackpad . 16 | 17 | 3. Run the container. Docker doesn't let you automatically mount a directory on your host machine in the container, so you'll need to specify by hand. 18 | 19 | Replace /path/to/this/repo below with the path to the current repository. Leave the other path alone. 20 | 21 | docker run -d -p 9000:9000 -v /path/to/this/repo:/etc/hackpad/src hackpad 22 | 23 | This will build hackpad, run schema migrations, and then start the server. It may take a few minutes. If you want to see what's going on, do: 24 | 25 | docker logs -f [container name] 26 | 27 | 4. Fix networking (one time only). If you're on OS X or Windows, you'll need to set up port forwarding to have Hackpad work properly. Linux folk can skip this. 28 | 29 | 1. Open VirtualBox 30 | 31 | 2. Select the `default` image and click Settings 32 | 33 | 3. Go to Network -> Adapter 1 -> Port forwarding 34 | 35 | 4. Create a custom rule like so: 36 | 37 | * Host IP: 127.0.0.1 38 | * Host Port: 9000 39 | * Guest IP: blank 40 | * Guest Port: 9000 41 | 42 | You should only have to do this once. 43 | 44 | At this point you should be able to open http://localhost:9000 in a browser and see the Hackpad page. 45 | 46 | 5. Create a password for the admin account. 47 | 48 | As part of the Docker setup, Hackpad is configured with 'admin@localhost.info' as a admin account, but you'll need to create a password to log in. 49 | 50 | To do that: 51 | 52 | 1. Open http://localhost:9000 and click Log In 53 | 54 | 2. Create an account with 'admin@localhost.info' and any password you like. 55 | 56 | 3. From the command line, run: 57 | 58 | 1. Find the name of your running container by running `docker ps`. Note the name. 59 | 60 | 2. Run this query and find the token: 61 | 62 | docker exec -it [container name] mysql -D hackpad -e 'select * from email_signup;' 63 | 64 | 3. Load this in a browser: http://localhost:9000/ep/account/validate-email?email=admin%40localhost.info&token=TOKEN 65 | 66 | 67 | You're all set! You should be able to edit the Hackpad source code and the docker container will track those changes. 68 | 69 | -------------------------------------------------------------------------------- /hackpad/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | HACKPAD_SRC="/etc/hackpad/src" 5 | 6 | if [ "$1" = 'hackpad' ]; then 7 | 8 | if [ ! -d "$HACKPAD_SRC" ]; then 9 | echo "The directory $HACKPAD_SRC doesn't exist." 10 | echo "You're probably running this on the host machine and not in the Docker container. Don't do that." 11 | echo "If this is happening on the Docker container, try building a new image from scratch." 12 | exit 1 13 | fi 14 | 15 | cd "$HACKPAD_SRC" 16 | 17 | # sanity check that we see any files at all. 18 | if [ ! -f "$HACKPAD_SRC/README.md" ]; then 19 | echo "I can't find any Hackpad source files. Did you forget to mount the volume?" 20 | echo "e.g., docker run -d -p 9000:9000 -v /path/to/this/repo:/etc/hackpad/src hackpad" 21 | exit 1 22 | fi 23 | 24 | echo "-->Editing configuration files" 25 | 26 | sed 's:^export SCALA_HOME=".*$:export SCALA_HOME="/usr/share/java":' -i'' bin/exports.sh 27 | sed 's:^export SCALA_LIBRARY_JAR=".*$:export SCALA_LIBRARY_JAR="$SCALA_HOME/scala-library.jar":' -i'' bin/exports.sh 28 | sed 's:^export JAVA_HOME=".*$:export JAVA_HOME="/usr/share/java":' -i'' bin/exports.sh 29 | 30 | cp etherpad/etc/etherpad.localdev-default.properties etherpad/etc/etherpad.local.properties 31 | sed 's:__email_addresses_with_admin_access__:admin@localhost.info:' -i'' etherpad/etc/etherpad.local.properties 32 | 33 | echo "-->Running build" 34 | 35 | ./bin/build.sh 36 | 37 | echo "-->Starting mysql" 38 | service mysql restart 39 | 40 | echo "-->Creating database" 41 | ./contrib/scripts/setup-mysql-db.sh -p "" 42 | 43 | 44 | echo 45 | echo "Starting server. The admin account is 'admin@localhost.info'." 46 | echo 47 | 48 | ./bin/run.sh 49 | 50 | elif [[ "$1" = 'server' ]]; then 51 | echo 52 | echo "Starting server." 53 | echo 54 | 55 | ./bin/run.sh 56 | 57 | fi 58 | 59 | exec "$@" 60 | -------------------------------------------------------------------------------- /hans/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | RUN apk update && apk add --virtual BUILD g++ linux-headers git make && \ 3 | apk add --no-cache libstdc++ libgcc && \ 4 | git clone https://github.com/friedrich/hans.git && \ 5 | cd /hans && make && chmod a+x /hans/hans && \ 6 | mv /hans/hans /bin/hans && rm -rf /hans && \ 7 | apk del BUILD 8 | ENTRYPOINT ["hans"] 9 | -------------------------------------------------------------------------------- /hexo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | 3 | ENV GIT_USER=izuolan 4 | ENV GIT_EMAIL=i@zuolan.me 5 | 6 | WORKDIR /hexo 7 | 8 | RUN apk add --update --no-cache git openssh entr && \ 9 | npm install hexo-cli -g && \ 10 | rm -rf /var/cache/apk/* && \ 11 | rm -rf /tmp/* 12 | 13 | COPY monitor.sh /monitor.sh 14 | VOLUME ["/hexo", "/root/.ssh"] 15 | 16 | CMD ["sh", "/monitor.sh"] 17 | -------------------------------------------------------------------------------- /hexo/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | hexo: 4 | container_name: hexo 5 | image: zuolan/hexo 6 | restart: always 7 | environment: 8 | - GIT_USER=izuolan 9 | - GIT_EMAIL=i@zuolan.me 10 | volumes: 11 | - ./:/hexo 12 | - $HOME/.ssh:/root/.ssh 13 | nginx: 14 | container_name: blog 15 | image: nginx:alpine 16 | restart: always 17 | volumes: 18 | - ./public:/usr/share/nginx/html:ro 19 | ports: 20 | - "4000:80" 21 | -------------------------------------------------------------------------------- /hexo/font-spider/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mhart/alpine-node 2 | USER root 3 | RUN apk add --no-cache python g++ make 4 | RUN npm install -g font-spider 5 | WORKDIR /work 6 | # CMD ["/run.sh"] 7 | # font-spider /html/* 8 | -------------------------------------------------------------------------------- /hexo/monitor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ ! -f "/hexo/_config.yml" ]; then 3 | echo "Monitor: _config.yml not found, runing hexo init" 4 | hexo init . 5 | fi 6 | SEPARATOR="================================================================" 7 | echo "正在执行初次构建:" 8 | echo $SEPARATOR 9 | echo "正在构建并部署页面:" 10 | npm install hexo --save 11 | yarn add hexo-deployer-git hexo-deployer-shell hexo-neat 12 | yarn install 13 | git config --global user.name "$GIT_USER" 14 | git config --global user.email "$GIT_EMAIL" 15 | ssh -o "StrictHostKeyChecking no" -T git@github.com 16 | hexo d -g 17 | # chmod 777 -R /hexo/public 18 | echo "页面已经发布,容器进入监视状态。" 19 | while true; do 20 | find _config.yml source themes | entr sh -c 'hexo d -g' 21 | done 22 | -------------------------------------------------------------------------------- /hugo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM busybox 2 | ENV BASE_URL=http://example.com/ 3 | WORKDIR /hugo 4 | ADD hugo run.sh /bin/ 5 | CMD ["run.sh"] 6 | -------------------------------------------------------------------------------- /hugo/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | VERSION=0.20.2 3 | wget https://github.com/spf13/hugo/releases/download/v${VERSION}/hugo_${VERSION}_Linux-64bit.tar.gz 4 | tar xf hugo_${VERSION}_Linux-64bit.tar.gz 5 | mv hugo_${VERSION}_linux_amd64/hugo_${VERSION}_linux_amd64 hugo 6 | docker build -t zuolan/hugo . 7 | -------------------------------------------------------------------------------- /hugo/minify/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mhart/alpine-node 2 | ENV BASE_URL=http://example.com/ 3 | COPY . /work 4 | RUN cd /work && npm install && \ 5 | apk add --no-cache hugo && \ 6 | chmod a+x /work/run.sh 7 | WORKDIR /hugo 8 | CMD ["/work/run.sh"] 9 | -------------------------------------------------------------------------------- /hugo/minify/gulpfile.babel.js: -------------------------------------------------------------------------------- 1 | import gulp from 'gulp' 2 | import htmlmin from 'gulp-htmlmin' 3 | import uglify from 'gulp-uglify' 4 | import runSequence from 'run-sequence' 5 | 6 | gulp.task('minify-html', () => { 7 | return gulp.src('html/**/*.html') 8 | .pipe(htmlmin({ 9 | collapseWhitespace: true, 10 | minifyCSS: true, 11 | minifyJS: true, 12 | removeComments: true, 13 | useShortDoctype: true, 14 | })) 15 | .pipe(gulp.dest('./html')) 16 | }) 17 | 18 | gulp.task('minify-js', () => { 19 | return gulp.src('./html/**/*.js') 20 | .pipe(uglify()) 21 | .pipe(gulp.dest('./html')); 22 | }); 23 | 24 | gulp.task('build', (callback) => { 25 | runSequence('minify-html','minify-js', callback) 26 | }) 27 | -------------------------------------------------------------------------------- /hugo/minify/html/indec.html: -------------------------------------------------------------------------------- 1 | /tmp/hugo.log 4 | tail -fn0 /tmp/hugo.log | \ 5 | while read line; do 6 | echo "$line" | grep "total" 7 | if [ "$?" = "0" ]; then 8 | cd /work && npm run build 9 | fi 10 | done 11 | -------------------------------------------------------------------------------- /hugo/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | hugo server --baseURL=$BASE_URL --bind=0.0.0.0 --appendPort=false 3 | -------------------------------------------------------------------------------- /kodexplorer-lamp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tutum/lamp:latest 2 | MAINTAINER izuolan 3 | RUN apt update -y && apt install -y php5-gd 4 | WORKDIR /app 5 | RUN rm -fr /app && git clone https://github.com/kalcaddle/KODExplorer.git /app 6 | RUN chmod -R 777 /app 7 | EXPOSE 80 3306 8 | CMD ["/run.sh"] 9 | -------------------------------------------------------------------------------- /kodexplorer-lamp/README.md: -------------------------------------------------------------------------------- 1 | # KODExplorer-dockerfile 2 | KODExplorer for docker 3 | ``` 4 | docker run -d -p 80:80 -p 3306:3306 -e MYSQL_PASS="mypass" -v /app:/app -v /data:/var/lib/mysql zuolan/kode 5 | ``` 6 | 7 | -------------------------------------------------------------------------------- /leanote/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | ARG LEANOTE_VERSION=2.5 4 | 5 | RUN apk add --no-cache --update wget ca-certificates \ 6 | && wget https://jaist.dl.sourceforge.net/project/leanote-bin/${LEANOTE_VERSION}/leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz \ 7 | && tar -zxf leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz -C / \ 8 | && rm -rf /leanote/mongodb_backup \ 9 | && rm leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz \ 10 | && chmod a+x /leanote/bin/run.sh && chmod a+x /leanote/bin/leanote-linux-amd64 \ 11 | && sed -i '/chmod/d' /leanote/bin/run.sh \ 12 | && apk del --purge wget 13 | 14 | VOLUME /leanote/public/upload 15 | 16 | EXPOSE 9000 17 | 18 | CMD ["/leanote/bin/run.sh"] 19 | -------------------------------------------------------------------------------- /leanote/README.md: -------------------------------------------------------------------------------- 1 | 首先在这个文件夹内执行: 2 | ``` 3 | bash get-data.sh 4 | ``` 5 | 6 | 然后执行: 7 | ``` 8 | docker-compose run --rm initdb 9 | ``` 10 | 11 | 最后启动: 12 | ``` 13 | docker-compose up -d leanote 14 | ``` 15 | 16 | 打开 localhost:9000 即可看到部署成功。 17 | -------------------------------------------------------------------------------- /leanote/app.conf: -------------------------------------------------------------------------------- 1 | #------------------------ 2 | # leanote config 3 | #------------------------ 4 | 5 | http.port=9000 6 | 7 | site.url=http://localhost:9000 # or http://x.com:8080, http://www.xx.com:9000 8 | 9 | # admin username 10 | adminUsername=admin 11 | 12 | # mongdb 13 | db.host=mongo 14 | db.port=27017 15 | db.dbname=leanote # required 16 | db.username= # if not exists, please leave it blank 17 | db.password= # if not exists, please leave it blank 18 | # or you can set the mongodb url for more complex needs the format is: 19 | # mongodb://myuser:mypass@localhost:40001,otherhost:40001/mydb 20 | # db.url=mongodb://root:root123@localhost:27017/leanote 21 | # db.urlEnv=${MONGODB_URL} # set url from env. eg. mongodb://root:root123@localhost:27017/leanote 22 | 23 | # You Must Change It !! About Security!! 24 | app.secret=V85ZzBeTnzpsHyjQX4zuKbQ8qqtJu9y2aDM55VWxAH1Q0p19poekx3xkcDVvrD0y # 25 | 26 | #-------------------------------- 27 | # revel config 28 | # for dev 29 | #-------------------------------- 30 | app.name=leanote 31 | http.addr= 32 | http.ssl=false 33 | cookie.httponly=false 34 | cookie.prefix=LEANOTE 35 | cookie.domain= # for share cookie with sub-domain 36 | cookie.secure=false 37 | format.date=2006-01-02 38 | format.datetime=2006-01-02 15:04:05 # 必须这样配置 39 | results.chunked=false 40 | 41 | log.trace.prefix = "TRACE " 42 | log.info.prefix = "INFO " 43 | log.warn.prefix = "WARN " 44 | log.error.prefix = "ERROR " 45 | 46 | # The default language of this application. 47 | i18n.default_language=en-us 48 | 49 | module.static=github.com/revel/modules/static 50 | 51 | [dev] 52 | mode.dev=true 53 | results.pretty=true 54 | watch=true 55 | 56 | module.testrunner = # github.com/revel/modules/testrunner 57 | 58 | log.trace.output = stderr 59 | log.info.output = stderr 60 | log.warn.output = stderr 61 | log.error.output = stderr 62 | 63 | [prod] 64 | mode.dev=false 65 | results.pretty=false 66 | watch=false 67 | 68 | module.testrunner = 69 | 70 | log.trace.output = off 71 | log.info.output = off 72 | log.warn.output = %(app.name)s.log 73 | log.error.output = %(app.name)s.log 74 | -------------------------------------------------------------------------------- /leanote/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | leanote: 4 | container_name: leanote_app 5 | image: zuolan/leanote 6 | ports: 7 | - "9000:9000" 8 | volumes: 9 | - ./app.conf:/leanote/conf/app.conf 10 | - ./upload:/leanote/public/upload 11 | - /etc/localtime:/etc/localtime:ro 12 | links: 13 | - mongo 14 | restart: always 15 | 16 | mongo: 17 | container_name: leanote_db 18 | image: mongo 19 | volumes: 20 | - ./data:/data/db 21 | - /etc/localtime:/etc/localtime:ro 22 | restart: always 23 | 24 | initdb: 25 | container_name: leanote_init 26 | image: mongo 27 | links: 28 | - mongo 29 | volumes: 30 | - ./initdb.sh:/initdb.sh 31 | - ./mongodb_backup:/mongodb_backup 32 | command: sh /initdb.sh 33 | 34 | networks: 35 | default: 36 | external: 37 | name: nginx 38 | -------------------------------------------------------------------------------- /leanote/get-data.sh: -------------------------------------------------------------------------------- 1 | #! bin/sh 2 | LEANOTE_VERSION=2.6 3 | wget https://jaist.dl.sourceforge.net/project/leanote-bin/${LEANOTE_VERSION}/leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz 4 | tar zxf leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz 5 | mv leanote/mongodb_backup . 6 | rm -rf leanote && rm leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz 7 | -------------------------------------------------------------------------------- /leanote/initdb.sh: -------------------------------------------------------------------------------- 1 | #! bin/sh 2 | echo "Loading...." 3 | sleep 5 4 | mongorestore -h mongo -d leanote --dir /mongodb_backup/leanote_install_data/ 5 | -------------------------------------------------------------------------------- /leanote/src/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | ARG LEANOTE_VERSION=2.3 3 | RUN apk add --no-cache git && \ 4 | go get -v github.com/revel/cmd/revel && \ 5 | mkdir -p /go/src/github.com/leanote/leanote/ && \ 6 | ln -s /go/src/github.com/leanote /leanote 7 | 8 | VOLUME /leanote 9 | EXPOSE 9000 10 | CMD ["sh","/leanote/bin/run-linux-amd64.sh"] 11 | -------------------------------------------------------------------------------- /leanote/src/README.md: -------------------------------------------------------------------------------- 1 | 这个文件夹存放的是从源代码安装 Leanote 的 Docker 配置文件。 2 | 也就是“开发版”。 3 | 使用方法也是先执行: 4 | ``` 5 | bash get-src.sh 6 | ``` 7 | 然后执行数据库初始化: 8 | ``` 9 | docker-compose run --rm initdb 10 | ``` 11 | 最后启动 Leanote 即可: 12 | ``` 13 | docker-compose up -d leanote 14 | ``` 15 | -------------------------------------------------------------------------------- /leanote/src/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | leanote: 4 | container_name: leanote_app 5 | image: zuolan/leanote:src 6 | ports: 7 | - "9000:9000" 8 | volumes: 9 | - ./leanote:/leanote 10 | - /etc/localtime:/etc/localtime:ro 11 | links: 12 | - mongo 13 | restart: always 14 | 15 | mongo: 16 | container_name: leanote_db 17 | image: mongo 18 | volumes: 19 | - ./data:/data/db 20 | - /etc/localtime:/etc/localtime:ro 21 | restart: always 22 | 23 | initdb: 24 | container_name: leanote_init 25 | image: mongo 26 | links: 27 | - mongo 28 | volumes: 29 | - ./initdb.sh:/initdb.sh 30 | - ./leanote/mongodb_backup:/mongodb_backup 31 | command: sh /initdb.sh 32 | 33 | networks: 34 | default: 35 | external: 36 | name: nginx 37 | -------------------------------------------------------------------------------- /leanote/src/get-src.sh: -------------------------------------------------------------------------------- 1 | #! bin/sh 2 | LEANOTE_VERSION=2.3 3 | wget https://jaist.dl.sourceforge.net/project/leanote-bin/${LEANOTE_VERSION}/leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz 4 | tar zxf leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz 5 | rm leanote-linux-amd64-v${LEANOTE_VERSION}.bin.tar.gz 6 | sed -i 's/db.host=127.0.0.1/db.host=mongo/g' ./leanote/conf/app.conf 7 | -------------------------------------------------------------------------------- /leanote/src/initdb.sh: -------------------------------------------------------------------------------- 1 | #! bin/sh 2 | mongorestore -h mongo -d leanote --dir /mongodb_backup/leanote_install_data/ 3 | -------------------------------------------------------------------------------- /lepto/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | RUN apk --repository http://dl-3.alpinelinux.org/alpine/edge/testing \ 3 | add --update --no-cache vips-tools vips-dev fftw-dev && \ 4 | apk add --update --no-cache --virtual build-tools make g++ && \ 5 | yarn global add lepto-cli && \ 6 | apk del build-tools && \ 7 | rm -rf /var/cache/apk/* 8 | WORKDIR /srv 9 | EXPOSE 4490 10 | VOLUME ["/srv"] 11 | CMD ["lepto"] 12 | -------------------------------------------------------------------------------- /lnmp/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lnmp/app/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Hello World 8 | 9 | -------------------------------------------------------------------------------- /lnmp/conf.d/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | # listen 443 ssl; 4 | # ssl_certificate /etc/nginx/server.crt; 5 | # ssl_certificate_key /etc/nginx/server.key; 6 | # ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 7 | # ssl_ciphers HIGH:!aNULL:!MD5; 8 | # ssl_prefer_server_ciphers on; 9 | 10 | server_name localhost; 11 | 12 | #charset koi8-r; 13 | #access_log /var/log/nginx/log/host.access.log main; 14 | 15 | location / { 16 | root /usr/share/nginx/html; 17 | index index.html index.htm index.php; 18 | } 19 | 20 | #error_page 404 /404.html; 21 | 22 | # redirect server error pages to the static page /50x.html 23 | # 24 | error_page 500 502 503 504 /50x.html; 25 | location = /50x.html { 26 | root /usr/share/nginx/html; 27 | } 28 | 29 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 30 | # 31 | #location ~ \.php$ { 32 | # proxy_pass http://127.0.0.1; 33 | #} 34 | 35 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 36 | # 37 | location ~ \.php$ { 38 | root html; 39 | fastcgi_pass __DOCKER_PHP_FPM__:9000; 40 | fastcgi_index index.php; 41 | fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; 42 | include fastcgi_params; 43 | } 44 | 45 | # deny access to .htaccess files, if Apache's document root 46 | # concurs with nginx's one 47 | # 48 | location ~ /\.ht { 49 | deny all; 50 | } 51 | } -------------------------------------------------------------------------------- /lnmp/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # web server 2 | nginx: 3 | image: reg.zuolan.me/library/nginx:alpine 4 | ports: 5 | - "80:80" 6 | # - "443:443" 7 | volumes: 8 | # app 9 | - /home/zuolan/docker/app/:/usr/share/nginx/html/ 10 | # nginx configs 11 | - /home/zuolan/docker/conf.d/:/etc/nginx/conf.d/:ro 12 | # certificates 13 | # - ./server.crt/:/etc/nginx/server.crt:ro 14 | # - ./server.key/:/etc/nginx/server.key:ro 15 | links: 16 | - fpm:__DOCKER_PHP_FPM__ 17 | 18 | # php-fpm 19 | fpm: 20 | image: reg.zuolan.me/library/php:7.0-fpm 21 | ports: 22 | - "9000:9000" 23 | volumes: 24 | - /home/zuolan/docker/app/:/usr/share/nginx/html 25 | # Your php.ini 26 | - /home/zuolan/docker/php/php.ini-production:/usr/local/etc/php/php.ini:ro 27 | # environment: 28 | # Set your APP env variables here: 29 | # - APP_KEY= 30 | # - DB_HOST= 31 | # - DB_DATABASE= 32 | # - DB_USERNAME= 33 | # - DB_PASSWORD= 34 | links: 35 | - mysql:mysql 36 | 37 | # database 38 | mysql: 39 | image: reg.zuolan.me/library/mysql:5.6 40 | ports: 41 | # Allow client to access 3306 42 | - "3306:3306" 43 | volumes: 44 | - /home/zuolan/docker/mysql:/var/lib/mysql 45 | environment: 46 | - MYSQL_ROOT_PASSWORD=YOUR_PASSWORD 47 | -------------------------------------------------------------------------------- /lxde-vnc-ubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | MAINTAINER Sven Hartmann 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | ENV HOME /root 6 | 7 | RUN apt-mark hold initscripts udev plymouth mountall 8 | RUN dpkg-divert --local --rename --add /sbin/initctl && ln -sf /bin/true /sbin/initctl 9 | 10 | RUN sed -i "/^# deb.*multiverse/ s/^# //" /etc/apt/sources.list 11 | 12 | RUN apt-get update && apt-get upgrade -y --force-yes && apt-get dist-upgrade -y --force-yes \ 13 | && apt-get install -y --force-yes --no-install-recommends supervisor \ 14 | openssh-server sudo \ 15 | net-tools \ 16 | lxde-core lxde-icon-theme x11vnc xvfb screen openbox \ 17 | nodejs wget \ 18 | firefox \ 19 | htop bmon nano \ 20 | lxterminal \ 21 | # vnc-java \ 22 | && apt-get autoclean \ 23 | && apt-get autoremove \ 24 | && rm -rf /var/lib/apt/lists/* 25 | 26 | ### Install Java 8 and JNA 27 | #RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list 28 | #RUN echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list 29 | #RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 30 | #RUN apt-get update -y 31 | #RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections 32 | #RUN apt-get install -y --force-yes oracle-java8-installer 33 | #RUN apt-get install -y --force-yes oracle-java8-set-default 34 | #RUN mkdir /tmp/jna-4.0.0 && \ 35 | # cd /tmp/jna-4.0.0 && \ 36 | # wget --no-check-certificate 'https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna/4.0.0/jna-4.0.0.jar' && \ 37 | # wget --no-check-certificate 'https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna-platform/4.0.0/jna-platform-4.0.0.jar' && \ 38 | # cd /tmp/jna-4.0.0 && \ 39 | # cd /usr/share/java && \ 40 | # [ -f jna.jar ] && rm jna.jar || \ 41 | # cp /tmp/jna-4.0.0/*.jar . && \ 42 | # ln -s jna-4.0.0.jar jna.jar && \ 43 | # ln -s jna-platform-4.0.0.jar jna-platform.jar && \ 44 | # java -jar jna.jar 45 | 46 | ADD startup.sh / 47 | ADD supervisord.conf / 48 | EXPOSE 5800 49 | EXPOSE 5900 50 | EXPOSE 22 51 | WORKDIR / 52 | ENTRYPOINT ["/startup.sh"] 53 | -------------------------------------------------------------------------------- /lxde-vnc-ubuntu/README.md: -------------------------------------------------------------------------------- 1 | #sidirius/docker-lxde-vnc 2 | 3 | Manual Build: 4 | -- 5 | git clone https://github.com/Sidirius/docker-lxde-vnc.git 6 | cd docker-lxde-vnc 7 | ./build.sh 8 | 9 | Run: 10 | -- 11 | docker run -dt --name lxde_vnc -p 5900:5900 -p 5800:5800 -e passwd="*your_password_for_vnc*" sidirius/docker-lxde-vnc 12 | -------------------------------------------------------------------------------- /lxde-vnc-ubuntu/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build --rm -t sidirius/docker-lxde-vnc . 3 | 4 | 5 | -------------------------------------------------------------------------------- /lxde-vnc-ubuntu/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir /var/run/sshd 3 | if [ ! -f /root/.vnc/passwd ] 4 | then 5 | mkdir /root/.vnc 6 | x11vnc -storepasswd $passwd /root/.vnc/passwd 7 | fi 8 | /usr/bin/supervisord -c /supervisord.conf 9 | 10 | while [ 1 ]; do 11 | /bin/bash 12 | done 13 | -------------------------------------------------------------------------------- /lxde-vnc-ubuntu/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=false 3 | 4 | [program:ssh] 5 | priority=10 6 | directory=/ 7 | command=/usr/sbin/sshd -D 8 | user=root 9 | autostart=true 10 | autorestart=true 11 | stopsignal=QUIT 12 | 13 | [program:xvfb] 14 | priority=10 15 | directory=/ 16 | command=/usr/bin/Xvfb :1 -screen 0 1700x950x24 17 | user=root 18 | autostart=true 19 | autorestart=true 20 | stopsignal=QUIT 21 | stdout_logfile=/var/log/xvfb.log 22 | stderr_logfile=/var/log/xvfb.err 23 | 24 | [program:lxsession] 25 | priority=15 26 | directory=/root 27 | command=/usr/bin/lxsession 28 | user=root 29 | autostart=true 30 | autorestart=true 31 | stopsignal=QUIT 32 | environment=DISPLAY=":1",HOME="/root" 33 | stdout_logfile=/var/log/lxsession.log 34 | stderr_logfile=/var/log/lxsession.err 35 | 36 | [program:x11vnc] 37 | priority=20 38 | directory=/ 39 | #command=x11vnc -display :1 -usepw -forever -share -rfbport 5900 40 | command=x11vnc -display :1 -usepw -forever -rfbport 5900 -httpdir /usr/share/vnc-java/ -httpport 5800 41 | user=root 42 | autostart=true 43 | autorestart=true 44 | stopsignal=QUIT 45 | stdout_logfile=/var/log/x11vnc.log 46 | stderr_logfile=/var/log/x11vnc.err 47 | -------------------------------------------------------------------------------- /mongo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ 3 | apk add --no-cache ca-certificates mongodb wget mongodb-tools && \ 4 | rm /usr/bin/mongosniff /usr/bin/mongoperf 5 | EXPOSE 27017 6 | VOLUME /data/db 7 | CMD ["mongod"] 8 | -------------------------------------------------------------------------------- /mongodb-tools/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ 3 | apk add --no-cache ca-certificates wget mongodb-tools 4 | EXPOSE 27017 5 | VOLUME /data/db 6 | CMD ["mongod"] 7 | -------------------------------------------------------------------------------- /nextcloud/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.6-apache 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | bzip2 \ 5 | libcurl4-openssl-dev \ 6 | libfreetype6-dev \ 7 | libicu-dev \ 8 | libjpeg-dev \ 9 | libldap2-dev \ 10 | libmcrypt-dev \ 11 | libmemcached-dev \ 12 | libpng12-dev \ 13 | libpq-dev \ 14 | libxml2-dev \ 15 | && rm -rf /var/lib/apt/lists/* 16 | 17 | # https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html 18 | RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ 19 | && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \ 20 | && docker-php-ext-install gd exif intl mbstring mcrypt ldap mysql opcache pdo_mysql pdo_pgsql pgsql zip 21 | 22 | # set recommended PHP.ini settings 23 | # see https://secure.php.net/manual/en/opcache.installation.php 24 | RUN { \ 25 | echo 'opcache.memory_consumption=128'; \ 26 | echo 'opcache.interned_strings_buffer=8'; \ 27 | echo 'opcache.max_accelerated_files=4000'; \ 28 | echo 'opcache.revalidate_freq=60'; \ 29 | echo 'opcache.fast_shutdown=1'; \ 30 | echo 'opcache.enable_cli=1'; \ 31 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 32 | RUN a2enmod rewrite 33 | 34 | # PECL extensions 35 | RUN set -ex \ 36 | && pecl install APCu-4.0.10 \ 37 | && pecl install memcached-2.2.0 \ 38 | && pecl install redis-2.2.8 \ 39 | && docker-php-ext-enable apcu redis memcached 40 | RUN a2enmod rewrite 41 | 42 | ENV NEXTCLOUD_VERSION 11.0.2 43 | VOLUME /var/www/html 44 | 45 | RUN curl -fsSL -o nextcloud.tar.bz2 \ 46 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \ 47 | && curl -fsSL -o nextcloud.tar.bz2.asc \ 48 | "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc" \ 49 | && export GNUPGHOME="$(mktemp -d)" \ 50 | # gpg key from https://nextcloud.com/nextcloud.asc 51 | && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A \ 52 | && gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2 \ 53 | && rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc \ 54 | && tar -xjf nextcloud.tar.bz2 -C /usr/src/ \ 55 | && rm nextcloud.tar.bz2 56 | 57 | COPY docker-entrypoint.sh /entrypoint.sh 58 | 59 | ENTRYPOINT ["/entrypoint.sh"] 60 | CMD ["apache2-foreground"] 61 | -------------------------------------------------------------------------------- /nextcloud/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ ! -e '/var/www/html/version.php' ]; then 5 | tar cf - --one-file-system -C /usr/src/nextcloud . | tar xf - 6 | chown -R www-data /var/www/html 7 | fi 8 | 9 | exec "$@" 10 | -------------------------------------------------------------------------------- /nginx-ssh/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | MAINTAINER ZuoLan 3 | 4 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssh-server pwgen nginx 5 | RUN mkdir -p /var/run/sshd && \ 6 | sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config && \ 7 | sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config && \ 8 | sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config 9 | 10 | RUN apt-get autoremove -y && \ 11 | apt-get autoclean -y && \ 12 | apt-get clean -y && \ 13 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 14 | 15 | ADD set_root_pw.sh /set_root_pw.sh 16 | ADD run.sh /run.sh 17 | RUN chmod +x /*.sh 18 | 19 | ENV AUTHORIZED_KEYS **None** 20 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf 21 | ADD sites-enabled/ /etc/nginx/sites-enabled/ 22 | ADD app/ /app/ 23 | 24 | EXPOSE 22 80 25 | 26 | CMD ["/run.sh && /usr/sbin/nginx"] 27 | -------------------------------------------------------------------------------- /nginx-ssh/README.md: -------------------------------------------------------------------------------- 1 | ## nginx-ssh 2 | 3 | Simple Ubuntu docker images with SSH access and nginx 4 | 5 | #### Running zuolan/nginx-ssh 6 | 7 | `docker run -d -p 2222:22 -p 80:80 zuolan/nginx-ssh` 8 | 9 | The first time that you run your container, a random password will be generated 10 | for user `root`. To get the password, check the logs of the container by running: 11 | 12 | `docker logs ` 13 | 14 | You will see an output like the following: 15 | 16 | ``` 17 | ======================================================================== 18 | You can now connect to this Ubuntu container via SSH using: 19 | 20 | ssh -p root@ 21 | and enter the root password 'U0iSGVUCr7W3' when prompted 22 | 23 | Please remember to change the above password as soon as possible! 24 | ======================================================================== 25 | ``` 26 | 27 | In this case, `U0iSGVUCr7W3` is the password allocated to the `root` user. 28 | 29 | Done! 30 | 31 | 32 | #### Setting a specific password for the root account 33 | 34 | If you want to use a preset password instead of a random generated one, you can 35 | set the environment variable `ROOT_PASS` to your specific password when running the container: 36 | 37 | `docker run -d -p 2222:22 -p 80:80 -e ROOT_PASS="mypass" zuolan/nginx-ssh` 38 | 39 | 40 | #### Adding SSH authorized keys 41 | 42 | If you want to use your SSH key to login, you can use `AUTHORIZED_KEYS` environment variable. You can add more than one public key separating them by `,`: 43 | 44 | ``` 45 | docker run -d -p 2222:22 -p 80:80 -e AUTHORIZED_KEYS="`cat ~/.ssh/id_rsa.pub`" zuolan/nginx-ssh 46 | ``` 47 | 48 | #### About Nginx 49 | 50 | Start your image building the external ports 80 in all interfaces to your container: 51 | 52 | `docker run -d -p 80:80 zuolan/nginx-ssh` 53 | 54 | Test your deployment: 55 | 56 | `curl http://localhost/` 57 | 58 | `Hello world!` 59 | 60 | #### Loading your custom application 61 | 62 | In order to replace the "Hello World" application that comes bundled with this docker images, first create a new empty folder. Go to the new folder and create two subfolders: `sites-enabled` and `app`. Copy your configuration files to `sites-enabled` and you application files to `app`. Then create a new `Dockerfile` with the following contents: 63 | 64 | ``` 65 | FROM zuolan/nginx-ssh 66 | ADD sites-enabled/ /etc/nginx/sites-enabled/ 67 | ADD app/ /app/ 68 | RUN chown -R www-data:www-data /app/ 69 | EXPOSE 80 70 | ``` 71 | 72 | Remember to put your configuration files under the folder named `sites-enabled` and your website files under the folder `app`. Also, if you want to use a different port, change the `EXPOSE 80` in `Dockerfile` as well.(eg. `EXPOSE 443 80` will allow connections go through port `443` and `80`). 73 | After that, build the new `Dockerfile`: 74 | 75 | docker build -t username/my-nginx-ssh 76 | 77 | And test it: 78 | 79 | docker run -d -P username/my-nginx-ssh 80 | 81 | Test your deployment: 82 | 83 | curl http://localhost/ 84 | 85 | That's it! 86 | -------------------------------------------------------------------------------- /nginx-ssh/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello world! 4 | 16 | 17 | 18 |

Hello world!

19 | 20 | 21 | -------------------------------------------------------------------------------- /nginx-ssh/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "${AUTHORIZED_KEYS}" != "**None**" ]; then 4 | echo "=> Found authorized keys" 5 | mkdir -p /root/.ssh 6 | chmod 700 /root/.ssh 7 | touch /root/.ssh/authorized_keys 8 | chmod 600 /root/.ssh/authorized_keys 9 | IFS=$'\n' 10 | arr=$(echo ${AUTHORIZED_KEYS} | tr "," "\n") 11 | for x in $arr 12 | do 13 | x=$(echo $x |sed -e 's/^ *//' -e 's/ *$//') 14 | cat /root/.ssh/authorized_keys | grep "$x" >/dev/null 2>&1 15 | if [ $? -ne 0 ]; then 16 | echo "=> Adding public key to /root/.ssh/authorized_keys: $x" 17 | echo "$x" >> /root/.ssh/authorized_keys 18 | fi 19 | done 20 | fi 21 | 22 | if [ ! -f /.root_pw_set ]; then 23 | /set_root_pw.sh 24 | fi 25 | 26 | exec /usr/sbin/sshd -D 27 | -------------------------------------------------------------------------------- /nginx-ssh/set_root_pw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -f /.root_pw_set ]; then 4 | echo "Root password already set!" 5 | exit 0 6 | fi 7 | 8 | PASS=${ROOT_PASS:-$(pwgen -s 12 1)} 9 | _word=$( [ ${ROOT_PASS} ] && echo "preset" || echo "random" ) 10 | echo "=> Setting a ${_word} password to the root user" 11 | echo "root:$PASS" | chpasswd 12 | 13 | echo "=> Done!" 14 | touch /.root_pw_set 15 | 16 | echo "========================================================================" 17 | echo "You can now connect to this Ubuntu container via SSH using:" 18 | echo "" 19 | echo " ssh -p root@" 20 | echo "and enter the root password '$PASS' when prompted" 21 | echo "" 22 | echo "Please remember to change the above password as soon as possible!" 23 | echo "========================================================================" 24 | -------------------------------------------------------------------------------- /nginx-ssh/sites-enabled/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | root /app; 6 | index index.html index.htm; 7 | 8 | server_name localhost; 9 | 10 | location / { 11 | try_files $uri $uri/ =404; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /october/Dockerfile: -------------------------------------------------------------------------------- 1 | # FROM tutum/lamp 2 | FROM php:apache 3 | MAINTAINER izuolan 4 | 5 | RUN apt-get update && apt-get install -y \ 6 | libjpeg62-turbo-dev \ 7 | libmcrypt-dev \ 8 | libpng12-dev \ 9 | unzip \ 10 | curl \ 11 | && docker-php-ext-install mcrypt \ 12 | && docker-php-ext-install gd \ 13 | && docker-php-ext-install mbstring \ 14 | && docker-php-ext-install zip \ 15 | && curl -SL "http://octobercms.com/download" -o install-master.zip \ 16 | && unzip install-master.zip \ 17 | && mv install-master/* /var/www/html \ 18 | && rm -r install-master* \ 19 | && chown -R www-data:www-data /var/www/html/ \ 20 | && a2enmod rewrite 21 | RUN apt-get autoremove -y \ 22 | && apt-get autoclean -y \ 23 | && apt-get clean -y \ 24 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ 25 | -------------------------------------------------------------------------------- /october/README.md: -------------------------------------------------------------------------------- 1 | **Base on tutum-docker-lamp** 2 | 3 | ## RUN 4 | 5 | `docker run -d -p 80:80 -p 3306:3306 ` 6 | 7 | Connecting to the bundled MySQL server from within the container 8 | The bundled MySQL server has a root user with no password for local connections. Simply connect from your PHP code with this user: 9 | 10 | host_info; 13 | ?> 14 | Connecting to the bundled MySQL server from outside the container 15 | The first time that you run your container, a new user admin with all privileges will be created in MySQL with a random password. To get the password, check the logs of the container by running: 16 | 17 | docker logs $CONTAINER_ID 18 | You will see an output like the following: 19 | 20 | ======================================================================== 21 | You can now connect to this MySQL Server using: 22 | 23 | mysql -uadmin -p47nnf4FweaKu -h -P 24 | 25 | Please remember to change the above password as soon as possible! 26 | MySQL user 'root' has no password but only allows local connections 27 | ======================================================================== 28 | In this case, 47nnf4FweaKu is the password allocated to the admin user. 29 | 30 | You can then connect to MySQL: 31 | 32 | mysql -uadmin -p47nnf4FweaKu 33 | Remember that the root user does not allow connections from outside the container - you should use this admin user instead! 34 | 35 | Setting a specific password for the MySQL server admin account 36 | If you want to use a preset password instead of a random generated one, you can set the environment variable MYSQL_PASS to your specific password when running the container: 37 | 38 | docker run -d -p 80:80 -p 3306:3306 -e MYSQL_PASS="mypass" tutum/lamp 39 | You can now test your new admin password: 40 | 41 | mysql -uadmin -p"mypass" 42 | Disabling .htaccess 43 | .htaccess is enabled by default. To disable .htaccess, you can remove the following contents from Dockerfile 44 | 45 | # config to enable .htaccess 46 | ADD apache_default /etc/apache2/sites-available/000-default.conf 47 | RUN a2enmod rewrite 48 | -------------------------------------------------------------------------------- /pagekit/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | MAINTAINER ZuoLan 3 | 4 | RUN apt-get update && \ 5 | apt-get -y install \ 6 | nginx \ 7 | unzip \ 8 | wget \ 9 | ca-certificates \ 10 | php5 php5-fpm php5-cli php5-json php5-mysql php5-curl 11 | 12 | ENV PAGEKIT_VERSION 1.0.2 13 | RUN mkdir /pagekit 14 | WORKDIR /pagekit 15 | VOLUME ["/pagekit/storage", "/pagekit/app/cache"] 16 | 17 | RUN wget https://github.com/pagekit/pagekit/releases/download/$PAGEKIT_VERSION/pagekit-$PAGEKIT_VERSION.zip -O /pagekit/pagekit.zip && \ 18 | unzip /pagekit/pagekit.zip && rm /pagekit/pagekit.zip 19 | 20 | ADD nginx.conf /etc/nginx/nginx.conf 21 | 22 | RUN chown -R www-data: /pagekit && \ 23 | apt-get autoremove wget unzip -y && \ 24 | apt-get autoclean -y && \ 25 | apt-get clean -y && \ 26 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 27 | 28 | CMD ["sh", "-c", "service php5-fpm start && nginx"] 29 | -------------------------------------------------------------------------------- /pagekit/README.md: -------------------------------------------------------------------------------- 1 | [![Pagekit Banner](https://cloud.githubusercontent.com/assets/1716665/14317675/ba034b8c-fc09-11e5-81ed-f10f37d86ea5.png)](https://pagekit.com) 2 | 3 | ## Pagekit CMS 4 | 5 | [![Build Status](https://travis-ci.org/pagekit/pagekit.svg?branch=develop)](https://travis-ci.org/pagekit/pagekit) 6 | 7 | * [Dockerfile](https://github.com/izuolan/dockerfiles/tree/master/pagekit) `latest` 8 | * [Pagekit.com](https://pagekit.com) 9 | * [Github](https://github.com/pagekit/pagekit/) 10 | 11 | Docker image for the Pagekit CMS 12 | 13 | **Uses nginx + php5-fpm + MySQL** 14 | 15 | ## Usage 16 | ``` 17 | $ docker run -d -p 8080:80 pagekit/pagekit 18 | ``` 19 | 20 | ## Use with a MySQL container 21 | ``` 22 | $ docker run -d \ 23 | -e MYSQL_ROOT_PASSWORD=YOURPASSWORD \ 24 | -e MYSQL_DATABASE=pagekit \ 25 | --name pagekit-mysql \ 26 | mysql 27 | ``` 28 | ``` 29 | $ docker run -d \ 30 | -p 8080:80 \ 31 | --link pagekit-mysql:mysql \ 32 | --name pagekit-web \ 33 | pagekit/pagekit 34 | ``` 35 | On install, use `mysql` as host. 36 | 37 | ## Use Docker-compose 38 | 39 | * `mkdir ~/pagekit && cd ~/pagekit && vim docker-compose.yml` 40 | ``` 41 | version: '2' 42 | services: 43 | db: 44 | image: mysql 45 | expose: 46 | - "3306" 47 | environment: 48 | - MYSQL_ROOT_PASSWORD=YOURPASSWORD 49 | - MYSQL_DATABASE=pagekit 50 | volumes: 51 | - ~/pagekit/mysql:/var/lib/mysql 52 | pagekit: 53 | image: pagekit/pagekit 54 | ports: 55 | - "8080:80" 56 | links: 57 | - db:db 58 | volumes: 59 | - ~/pagekit/storage:/pagekit/storage 60 | - ~/pagekit/app/cache:/pagekit/app/cache 61 | ``` 62 | * Change your password `YOURPASSWORD` 63 | * Run `cd ~/pagekit && docker-compose up -d` 64 | * On install, use `db` as host. 65 | -------------------------------------------------------------------------------- /pagekit/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | db: 4 | image: mysql 5 | expose: 6 | - "3306" 7 | environment: 8 | - MYSQL_ROOT_PASSWORD=YOURPASSWORD 9 | - MYSQL_DATABASE=pagekit 10 | volumes: 11 | - ~/pagekit/mysql:/var/lib/mysql 12 | pagekit: 13 | image: pagekit/pagekit 14 | ports: 15 | - "8080:80" 16 | links: 17 | - db:db 18 | volumes: 19 | - ~/pagekit/storage:/pagekit/storage 20 | - ~/pagekit/app/cache:/pagekit/app/cache 21 | -------------------------------------------------------------------------------- /pagekit/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes 4; 3 | pid /run/nginx.pid; 4 | daemon off; 5 | 6 | events { 7 | worker_connections 768; 8 | # multi_accept on; 9 | } 10 | 11 | http { 12 | 13 | ## 14 | # Basic Settings 15 | ## 16 | 17 | sendfile on; 18 | tcp_nopush on; 19 | tcp_nodelay on; 20 | keepalive_timeout 65; 21 | types_hash_max_size 2048; 22 | # server_tokens off; 23 | 24 | # server_names_hash_bucket_size 64; 25 | # server_name_in_redirect off; 26 | 27 | include /etc/nginx/mime.types; 28 | default_type application/octet-stream; 29 | 30 | ## 31 | # Logging Settings 32 | ## 33 | 34 | access_log /var/log/nginx/access.log; 35 | error_log /var/log/nginx/error.log; 36 | 37 | ## 38 | # Gzip Settings 39 | ## 40 | 41 | gzip on; 42 | gzip_disable "msie6"; 43 | 44 | gzip_vary on; 45 | gzip_proxied any; 46 | gzip_comp_level 6; 47 | gzip_buffers 16 8k; 48 | gzip_http_version 1.1; 49 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 50 | 51 | server { 52 | root /pagekit; 53 | location / { 54 | try_files $uri $uri/ /index.php?$args; 55 | index index.html index.htm index.php; 56 | } 57 | location ~ \.php$ { 58 | try_files $uri $uri/ /index.php?$args; 59 | index index.html index.htm index.php; 60 | include fastcgi_params; 61 | fastcgi_index index.php; 62 | fastcgi_param PATH_INFO $fastcgi_path_info; 63 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 64 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 65 | fastcgi_param HTTP_MOD_REWRITE On; 66 | fastcgi_pass unix:/var/run/php5-fpm.sock; 67 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 68 | } 69 | } 70 | } 71 | 72 | -------------------------------------------------------------------------------- /pagekit/pagekit-sqlite/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | MAINTAINER ZuoLan 3 | 4 | RUN apt-get update && \ 5 | apt-get -y install \ 6 | nginx \ 7 | ca-certificates \ 8 | php5 php5-fpm php5-cli php5-json php5-mysql php5-curl php5-sqlite 9 | 10 | ENV PAGEKIT_VERSION 1.0.3 11 | RUN mkdir /pagekit 12 | WORKDIR /pagekit 13 | VOLUME /pagekit 14 | 15 | ADD nginx.conf /etc/nginx/nginx.conf 16 | 17 | RUN apt-get autoremove -y && \ 18 | apt-get autoclean -y && \ 19 | apt-get clean -y && \ 20 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 21 | 22 | CMD ["sh", "-c", "chown -R www-data: /pagekit && service php5-fpm start && nginx"] 23 | -------------------------------------------------------------------------------- /pagekit/pagekit-sqlite/README.md: -------------------------------------------------------------------------------- 1 | [![Pagekit Banner](https://cloud.githubusercontent.com/assets/1716665/14317675/ba034b8c-fc09-11e5-81ed-f10f37d86ea5.png)](https://pagekit.com) 2 | 3 | ## Pagekit CMS 4 | 5 | [![Build Status](https://travis-ci.org/pagekit/pagekit.svg?branch=develop)](https://travis-ci.org/pagekit/pagekit) 6 | 7 | * [Dockerfile](https://github.com/izuolan/dockerfiles/tree/master/pagekit) `latest` 8 | * [Pagekit.com](https://pagekit.com) 9 | * [Github](https://github.com/pagekit/pagekit/) 10 | 11 | Docker image for the Pagekit CMS 12 | 13 | **Uses nginx + php5-fpm + SQLite** 14 | 15 | ## Usage 16 | ``` 17 | $ docker run -d \ 18 | -p 8080:80 \ 19 | --name pagekit-web \ 20 | -v ~/pagekit:/pagekit \ 21 | pagekit/pagekit:sqlite 22 | ``` 23 | On install, use sqlite. 24 | 25 | ## Use Docker-compose 26 | * `mkdir ~/pagekit && cd ~/pagekit && vim docker-compose.yml` 27 | ``` 28 | version: '2' 29 | services: 30 | pagekit: 31 | image: pagekit/pagekit:sqlite 32 | ports: 33 | - "8080:80" 34 | volumes: 35 | - ~/pagekit:/pagekit/ 36 | ``` 37 | * `wget https://github.com/pagekit/pagekit/releases/download/1.0.3/pagekit-1.0.3.zip` 38 | * `cd ~/pagekit && unzip pagekit-1.0.3.zip` 39 | * Run `cd ~/pagekit && docker-compose up -d` 40 | * On install, use sqlite. 41 | -------------------------------------------------------------------------------- /pagekit/pagekit-sqlite/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | pagekit: 4 | image: pagekit/pagekit 5 | ports: 6 | - "8080:80" 7 | volumes: 8 | - ~/pagekit:/pagekit/ 9 | -------------------------------------------------------------------------------- /pagekit/pagekit-sqlite/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes 4; 3 | pid /run/nginx.pid; 4 | daemon off; 5 | 6 | events { 7 | worker_connections 768; 8 | # multi_accept on; 9 | } 10 | 11 | http { 12 | 13 | ## 14 | # Basic Settings 15 | ## 16 | 17 | sendfile on; 18 | tcp_nopush on; 19 | tcp_nodelay on; 20 | keepalive_timeout 65; 21 | types_hash_max_size 2048; 22 | # server_tokens off; 23 | 24 | # server_names_hash_bucket_size 64; 25 | # server_name_in_redirect off; 26 | 27 | include /etc/nginx/mime.types; 28 | default_type application/octet-stream; 29 | 30 | ## 31 | # Logging Settings 32 | ## 33 | 34 | access_log /var/log/nginx/access.log; 35 | error_log /var/log/nginx/error.log; 36 | 37 | ## 38 | # Gzip Settings 39 | ## 40 | 41 | gzip on; 42 | gzip_disable "msie6"; 43 | 44 | gzip_vary on; 45 | gzip_proxied any; 46 | gzip_comp_level 6; 47 | gzip_buffers 16 8k; 48 | gzip_http_version 1.1; 49 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 50 | 51 | server { 52 | root /pagekit; 53 | location / { 54 | try_files $uri $uri/ /index.php?$args; 55 | index index.html index.htm index.php; 56 | } 57 | location ~ \.php$ { 58 | try_files $uri $uri/ /index.php?$args; 59 | index index.html index.htm index.php; 60 | include fastcgi_params; 61 | fastcgi_index index.php; 62 | fastcgi_param PATH_INFO $fastcgi_path_info; 63 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 64 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 65 | fastcgi_param HTTP_MOD_REWRITE On; 66 | fastcgi_pass unix:/var/run/php5-fpm.sock; 67 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 68 | } 69 | } 70 | } 71 | 72 | -------------------------------------------------------------------------------- /php-apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | MAINTAINER ZuoLan 3 | 4 | # Install base packages 5 | RUN apt-get update && \ 6 | DEBIAN_FRONTEND=noninteractive apt-get -yq install \ 7 | curl \ 8 | apache2 \ 9 | libapache2-mod-php5 \ 10 | php5-mysql \ 11 | php5-mcrypt \ 12 | php5-gd \ 13 | php5-curl \ 14 | php-pear \ 15 | php-apc && \ 16 | rm -rf /var/lib/apt/lists/* && \ 17 | curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 18 | RUN /usr/sbin/php5enmod mcrypt 19 | RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf && \ 20 | sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini 21 | 22 | ENV ALLOW_OVERRIDE **False** 23 | 24 | # Add image configuration and scripts 25 | ADD run.sh /run.sh 26 | RUN chmod 755 /*.sh 27 | 28 | # Configure /app folder with sample app 29 | RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html 30 | ADD sample/ /app 31 | 32 | EXPOSE 80 33 | WORKDIR /app 34 | CMD ["/run.sh"] 35 | -------------------------------------------------------------------------------- /php-apache/Makefile: -------------------------------------------------------------------------------- 1 | all: php 2 | 3 | php: 4 | docker build -t tutum/docker-php . 5 | -------------------------------------------------------------------------------- /php-apache/README.md: -------------------------------------------------------------------------------- 1 | docker-php 2 | ================ 3 | 4 | Base docker image to run PHP applications on Apache 5 | 6 | 7 | Building the base image 8 | ----------------------- 9 | 10 | 11 | docker build -t zuolan/apache-php . 12 | 13 | 14 | Running your Apache+PHP docker image 15 | ------------------------------------ 16 | 17 | Start your image binding the external ports 80 in all interfaces to your container: 18 | 19 | docker run -d -p 80:80 zuolan/apache-php 20 | 21 | Test your deployment: 22 | 23 | open http://localhost/ 24 | 25 | 26 | Enable .htaccess files 27 | ------------------------------------ 28 | 29 | If you app uses .htaccess files you need to pass the ALLOW_OVERRIDE environment variable 30 | 31 | docker run -d -p 80:80 -e ALLOW_OVERRIDE=true zuolan/apache-php 32 | 33 | 34 | Loading your custom PHP application 35 | ----------------------------------- 36 | 37 | This image can be used as a base image for your PHP application. Create a new `Dockerfile` in your 38 | PHP application folder with the following contents: 39 | 40 | FROM zuolan/apache-php 41 | 42 | After that, build the new `Dockerfile`: 43 | 44 | docker build -t username/my-php-app . 45 | 46 | And test it: 47 | 48 | docker run -d -p 80:80 username/my-php-app 49 | 50 | Test your deployment: 51 | 52 | open http://localhost/ 53 | 54 | That's it! 55 | 56 | 57 | Loading your custom PHP application with composer requirements 58 | -------------------------------------------------------------- 59 | 60 | Create a Dockerfile like the following: 61 | 62 | FROM zuolan/apache-php 63 | RUN apt-get update && apt-get install -yq git && rm -rf /var/lib/apt/lists/* 64 | RUN rm -fr /app 65 | ADD . /app 66 | RUN composer install 67 | 68 | - Replacing `git` with any dependencies that your composer packages might need. 69 | - Add your php application to `/app` 70 | 71 | -------------------------------------------------------------------------------- /php-apache/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chown www-data:www-data /app -R 3 | 4 | if [ "$ALLOW_OVERRIDE" = "**False**" ]; then 5 | unset ALLOW_OVERRIDE 6 | else 7 | sed -i "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf 8 | a2enmod rewrite 9 | fi 10 | 11 | source /etc/apache2/envvars 12 | tail -F /var/log/apache2/* & 13 | exec apache2 -D FOREGROUND 14 | -------------------------------------------------------------------------------- /php-apache/sample/index.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /ptunnel/._CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/._CHANGELOG -------------------------------------------------------------------------------- /ptunnel/._LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/._LICENSE -------------------------------------------------------------------------------- /ptunnel/._README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/._README -------------------------------------------------------------------------------- /ptunnel/._ptunnel.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/._ptunnel.8 -------------------------------------------------------------------------------- /ptunnel/._ptunnel.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/._ptunnel.c -------------------------------------------------------------------------------- /ptunnel/._ptunnel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/._ptunnel.h -------------------------------------------------------------------------------- /ptunnel/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/CHANGELOG -------------------------------------------------------------------------------- /ptunnel/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | COPY . /build 3 | WORKDIR /build 4 | RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories && \ 5 | echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \ 6 | echo '@testing http://nl.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \ 7 | apk add --no-cache \ 8 | libpcap && \ 9 | apk add --no-cache --virtual BUILD linux-headers libpcap-dev build-base && \ 10 | make && make install && \ 11 | apk del BUILD && \ 12 | mv /build/client.sh /run.sh && \ 13 | rm -rf /build /var/cache/apk/* && \ 14 | chmod a+x /run.sh 15 | ENV IP=127.0.0.1 MIDDLE_PORT=8000 SSH_PORT=22 PASSWORD=pasword 16 | CMD ["/run.sh"] 17 | -------------------------------------------------------------------------------- /ptunnel/Dockerfile.server: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | COPY . /build 3 | WORKDIR /build 4 | RUN echo '@edge http://nl.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories && \ 5 | echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \ 6 | echo '@testing http://nl.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \ 7 | apk add --no-cache \ 8 | libpcap && \ 9 | apk add --no-cache --virtual BUILD linux-headers libpcap-dev build-base && \ 10 | make && make install && \ 11 | apk del BUILD && \ 12 | mv /build/server.sh /run.sh && \ 13 | chmod a+x /run.sh && \ 14 | rm -rf /var/cache/apk/* /build 15 | ENV PASSWORD=password 16 | CMD ["/run.sh"] 17 | -------------------------------------------------------------------------------- /ptunnel/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2009, Daniel Stoedle , 2 | Yellow Lemon Software. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | - Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Yellow Lemon Software nor the names of its 15 | contributors may be used to endorse or promote products derived from this 16 | software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /ptunnel/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the pingtunnel utility 2 | # (c) 2004-2009 Daniel Stoedle, daniels@cs.uit.no 3 | # ptunnel.exe target added by Mike Miller, mike@mikeage.net 4 | 5 | CC = gcc 6 | CFLAGS = -Wall -g 7 | LDOPTS = -lpthread -lpcap 8 | PT_OBJS = ptunnel.o md5.o 9 | 10 | WIN32_CC = mingw32-gcc 11 | WIN32_CFLAGS = -g -Wall -DWIN32 -I"c:\Program Files\WpdPack\Include" 12 | WIN32_LDOPTS = -lwpcap -lwsock32 -L"c:\Program Files\WpdPack\Lib" 13 | WIN32_PT_OBJS = ptunnel.obj md5.obj 14 | 15 | prefix = /usr 16 | bindir = $(prefix)/bin 17 | mandir = $(prefix)/share/man/man8 18 | 19 | all: ptunnel 20 | 21 | dist: 22 | rm -rf PingTunnel/ 23 | mkdir PingTunnel 24 | cp ptunnel.c ptunnel.h Makefile.dist PingTunnel/ 25 | mv PingTunnel/Makefile.dist PingTunnel/Makefile 26 | 27 | 28 | install: ptunnel 29 | install -d $(bindir)/ 30 | install -d $(mandir)/ 31 | install ./ptunnel $(bindir)/ptunnel 32 | install ./ptunnel.8 $(mandir)/ptunnel.8 33 | 34 | ptunnel: $(PT_OBJS) 35 | $(CC) -o $@ $^ $(LDOPTS) `[ -e /usr/include/selinux/selinux.h ] && echo -lselinux` 36 | 37 | ptunnel.exe: $(WIN32_PT_OBJS) 38 | $(CC) -o $@ $^ $(WIN32_LDOPTS) 39 | 40 | clean: 41 | -rm -f *.o ptunnel 42 | -rm -f *.obj ptunnel.exe 43 | -rm -f .depend 44 | 45 | depend: .depend 46 | .depend: 47 | $(CC) $(CFLAGS) -MM *.c > $@ 48 | 49 | %.o:%.c 50 | $(CC) $(CFLAGS) `[ -e /usr/include/selinux/selinux.h ] && echo -DHAVE_SELINUX` -c -o $@ $< 51 | 52 | %.obj:%.c 53 | $(WIN32_CC) $(WIN32_CFLAGS) -c -o $@ $< 54 | 55 | -include .depend 56 | -------------------------------------------------------------------------------- /ptunnel/README: -------------------------------------------------------------------------------- 1 | PingTunnel Read Me 2 | ================== 3 | 4 | What is ptunnel? 5 | ---------------- 6 | Ptunnel is an application that allows you to reliably tunnel TCP connections 7 | to a remote host using ICMP echo request and reply packets, commonly known as 8 | ping requests and replies. 9 | 10 | 11 | Contact details 12 | --------------- 13 | You can the author, Daniel Stoedle, here: 14 | 15 | The official ptunnel website is located here: 16 | 17 | The Windows port was created by Mike Miller: 18 | 19 | 20 | 21 | Compiling 22 | --------- 23 | To compile ptunnel, simply run make. If everything goes well, you should end up 24 | with a binary called ptunnel. This serves as both the client and proxy. You can 25 | optionally install it using "make install". On Windows, run "make ptunnel.exe" 26 | to compile the Windows binary. You will need mingw installed, as well as the 27 | WinPcap library. WinPcap is available here: 28 | 29 | 30 | 31 | Running 32 | ------- 33 | Ptunnel works best when running as root, and usually requires running as root. 34 | Again, from the website: 35 | 36 | Client: ./ptunnel -p -lp -da 37 | -dp [-c ] [-v ] [-u] 38 | [-x password] 39 | Proxy: ./ptunnel [-c ] [-v ] [-u] [-x password] 40 | 41 | The -p switch sets the address of the host on which the proxy is running. A 42 | quick test to see if the proxy will work is simply to try pinging this host - 43 | if you get replies, you should be able to make the tunnel work. 44 | 45 | The -lp, -da and -dp switches set the local listening port, destination address 46 | and destination port. For instance, to tunnel ssh connections from the client 47 | machine via a proxy running on proxy.pingtunnel.com to the computer 48 | login.domain.com, the following command line would be used: 49 | 50 | sudo ./ptunnel -p proxy.pingtunnel.com -lp 8000 -da login.domain.com -dp 22 51 | 52 | An ssh connection to login.domain.com can now be established as follows: 53 | 54 | ssh -p 8000 localhost 55 | 56 | If ssh complains about potential man-in-the-middle attacks, simply remove the 57 | offending key from the known_hosts file. The warning/error is expected if you 58 | have previously ssh'd to your local computer (i.e., ssh localhost), or you have 59 | used ptunnel to forward ssh connections to different hosts. 60 | 61 | Of course, for all of this to work, you need to start the proxy on your 62 | proxy-computer (we'll call it proxy.pingtunnel.com here). Doing this is very 63 | simple: 64 | 65 | sudo ./ptunnel 66 | 67 | If you find that the proxy isn't working, you will need to enable packet 68 | capturing on the main network device. Currently this device is assumed to be 69 | an ethernet-device (i.e., ethernet or wireless). Packet capturing is enabled by 70 | giving the -c switch, and supplying the device name to capture packets on (for 71 | instance eth0 or en1). The same goes for the client. On versions of Mac OS X 72 | prior to 10.4 (Tiger), packet capturing must always be enabled (both for proxy 73 | and client), as resent packets won't be received otherwise. 74 | 75 | To protect yourself from others using your proxy, you can protect access to it 76 | with a password using the -x switch. The password is never sent in 77 | the clear, but keep in mind that it may be visible from tools like top or ps, 78 | which can display the command line used to start an application. 79 | 80 | Finally, the -u switch will attempt to run the proxy in unprivileged mode (i.e., 81 | no need for root access), and the -v switch controls the amount of output from 82 | ptunnel. -1 indicates no output, 0 shows errors only, 1 shows info messages, 2 83 | gives more output, 3 provides even more output, level 4 displays debug info and 84 | level 5 displays absolutely everything, including the nasty details of sends and 85 | receives. The -f switch allows output to be saved to a logfile. 86 | 87 | Security features: Please see the ptunnel man-page for instructions. 88 | 89 | 90 | Supported operating systems 91 | --------------------------- 92 | Ptunnel supports most operating systems with libpcap, the usual POSIX functions 93 | and a BSD sockets compatible API. In particular, it has been tested on Linux 94 | Fedora Core 2 and Mac OS X 10.3.6 and above. As of version 0.7, ptunnel can also 95 | be compiled on Windows, courtesy of Mike Miller, assuming mingw and WinPcap is 96 | installed. 97 | 98 | 99 | Credits and contributors 100 | ------------------------ 101 | Thanks to L. Peter Deutsch for his open-source MD5 implementation, included with 102 | ptunnel, but also available here: 103 | http://sourceforge.net/projects/libmd5-rfc/ 104 | 105 | Many thanks also to Mike Miller for his work on creating a 106 | Windows port of ptunnel. 107 | 108 | Thanks to Sebastien Raveau for implementing various 109 | security features and SELinux support. 110 | 111 | Also thanks to Joe McKenzie, Steffen Wendzel and StalkR for contributing patches to 112 | ptunnel. 113 | 114 | License 115 | ------- 116 | Ping Tunnel is Copyright (c) 2004-2011, Daniel Stoedle , 117 | Yellow Lemon Software. All rights reserved. Ping Tunnel is licensed under the 118 | BSD License. Please see the LICENSE file for details. 119 | -------------------------------------------------------------------------------- /ptunnel/client.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | ptunnel -p $IP -lp $MIDDLE_PORT -da 127.0.0.1 -dp $SSH_PORT -x $PASSWORD 3 | -------------------------------------------------------------------------------- /ptunnel/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | ssh-keygen -A 3 | /usr/sbin/sshd -D -e & 4 | exec "$@" 5 | -------------------------------------------------------------------------------- /ptunnel/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would be 15 | appreciated but is not required. 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 3. This notice may not be removed or altered from any source distribution. 19 | 20 | L. Peter Deutsch 21 | ghost@aladdin.com 22 | 23 | */ 24 | /* $Id: md5.h,v 1.1 2005/04/15 07:37:22 daniels Exp $ */ 25 | /* 26 | Independent implementation of MD5 (RFC 1321). 27 | 28 | This code implements the MD5 Algorithm defined in RFC 1321, whose 29 | text is available at 30 | http://www.ietf.org/rfc/rfc1321.txt 31 | The code is derived from the text of the RFC, including the test suite 32 | (section A.5) but excluding the rest of Appendix A. It does not include 33 | any code or documentation that is identified in the RFC as being 34 | copyrighted. 35 | 36 | The original and principal author of md5.h is L. Peter Deutsch 37 | . Other authors are noted in the change history 38 | that follows (in reverse chronological order): 39 | 40 | 2002-04-13 lpd Removed support for non-ANSI compilers; removed 41 | references to Ghostscript; clarified derivation from RFC 1321; 42 | now handles byte order either statically or dynamically. 43 | 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 44 | 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); 45 | added conditionalization for C++ compilation from Martin 46 | Purschke . 47 | 1999-05-03 lpd Original version. 48 | */ 49 | 50 | #ifndef md5_INCLUDED 51 | # define md5_INCLUDED 52 | 53 | /* 54 | * This package supports both compile-time and run-time determination of CPU 55 | * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be 56 | * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is 57 | * defined as non-zero, the code will be compiled to run only on big-endian 58 | * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to 59 | * run on either big- or little-endian CPUs, but will run slightly less 60 | * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. 61 | */ 62 | 63 | typedef unsigned char md5_byte_t; /* 8-bit byte */ 64 | typedef unsigned int md5_word_t; /* 32-bit word */ 65 | 66 | /* Define the state of the MD5 Algorithm. */ 67 | typedef struct md5_state_s { 68 | md5_word_t count[2]; /* message length in bits, lsw first */ 69 | md5_word_t abcd[4]; /* digest buffer */ 70 | md5_byte_t buf[64]; /* accumulate block */ 71 | } md5_state_t; 72 | 73 | #ifdef __cplusplus 74 | extern "C" 75 | { 76 | #endif 77 | 78 | /* Initialize the algorithm. */ 79 | void md5_init(md5_state_t *pms); 80 | 81 | /* Append a string to the message. */ 82 | void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); 83 | 84 | /* Finish the message and return the digest. */ 85 | void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); 86 | 87 | #ifdef __cplusplus 88 | } /* end extern "C" */ 89 | #endif 90 | 91 | #endif /* md5_INCLUDED */ 92 | -------------------------------------------------------------------------------- /ptunnel/ptunnel-debian/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | RUN apt-get update && \ 3 | apt-get install openssh-server ptunnel -y && \ 4 | apt-get clean 5 | RUN echo "#! /bin/bash\n\ 6 | service ssh start \n\ 7 | ptunnel -p \$IP -lp \$MIDDLE_PORT -da 127.0.0.1 -dp \$SSH_PORT" >> /run.sh && \ 8 | chmod a+x /run.sh && \ 9 | cat /run.sh 10 | ENV IP=127.0.0.1 MIDDLE_PORT=8000 SSH_PORT=22 11 | # EXPOSE 22 8000 12 | # ENTRYPOINT 13 | CMD ["/run.sh"] 14 | -------------------------------------------------------------------------------- /ptunnel/ptunnel-debian/Dockerfile.server: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | RUN apt-get update && \ 3 | apt-get install ptunnel -y && \ 4 | apt-get clean 5 | #ENV PASSWD=password 6 | # EXPOSE 8000 7 | ENTRYPOINT ["/usr/sbin/ptunnel"] 8 | -------------------------------------------------------------------------------- /ptunnel/ptunnel.8: -------------------------------------------------------------------------------- 1 | .TH ptunnel 8 "September 5, 2011" "Version 0.72" "Yellow Lemon Software" 2 | .SH NAME 3 | ptunnel \- tunnel TCP connections over ICMP echo request/reply packets. 4 | .SH SYNOPSIS 5 | .B ptunnel 6 | \-p proxy_address \-lp listen_port \-da destination_address \-dp dest_port [\-c network_device] [\-v verbosity] [-f file] [-udp] [-syslog] 7 | 8 | .B ptunnel 9 | [\-c network_device] [\-v verbosity] [\-f file] [\-udp] [\-syslog] [\-daemon file] 10 | 11 | .B ptunnel 12 | [\-u] [\-x password] [\-setuid user] [\-setgid group] [\-chroot dir] [\-setcon context] 13 | 14 | .B ptunnel 15 | \-h 16 | .SH DESCRIPTION 17 | ptunnel is an application that allows you to reliably tunnel TCP connections to a remote host using ICMP echo request and reply packets, commonly known as ping requests and replies. At first glance, this might seem like a rather useless thing to do, but it can actually come in handy in some cases. The following example illustrates the main motivation in creating ptunnel: 18 | .PP 19 | Setting: You're on the go, and stumble across an open wireless network. The network gives you an IP address, but won't let you send TCP or UDP packets out to the rest of the internet, for instance to check your mail. What to do? By chance, you discover that the network will allow you to ping any computer on the rest of the internet. With ptunnel, you can utilize this feature to check your mail, or do other things that require TCP. 20 | .SH OPTIONS 21 | .TP 22 | .SH Client options: 23 | .TP 24 | .B \-p proxy_address 25 | Specify the host on which the proxy is running. 26 | .TP 27 | .B \-lp listen_port 28 | Specifies the port on which the client will listen for incoming TCP connections. 29 | .TP 30 | .B \-da destination_addr 31 | Specifies the address to which you want your packets tunneled after reaching the proxy when in client mode, or restricts the destination packets can be forwarded to when in server mode. 32 | .TP 33 | .B \-dp destination_port 34 | Specifies/restrict the port that the proxy should tunnel the TCP connection to. 35 | .TP 36 | .SH Shared options: 37 | .TP 38 | .B \-c network_device 39 | Specify the network interface to capture packets from. Note that packet capturing isn't always necessary, but you should try this if you experience problems with ptunnel. 40 | .TP 41 | .B \-v verbosity 42 | Controls the verbosity level. -1 is no output, 0 shows errors only, 1 shows info messages, 2 gives more output, 3 provides even more output, level 4 displays debug info and level 5 displays absolutely everything, including the nasty details of sends and receives. 43 | .TP 44 | .B \-udp 45 | Enables tunneling over UDP port 53 (DNS) instead of using ICMP. This will only work if your proxy can accept incoming traffic on port 53, and the client is able to send data to the proxy on port 53. Note that this option does not wrap ptunnel's data in DNS-compliant packets. This option must be given on both the proxy and client side for things to work correctly. 46 | .TP 47 | .B \-syslog (Not available on Windows.) 48 | Changes logging to use the built-in syslog fascility. 49 | .TP 50 | .B \-daemon file (Not available on Windows.) 51 | Run in background, writing PID in file. 52 | .TP 53 | .B \-u 54 | Attempts to run ptunnel without privileges. This doesn't usually work! On UNIX systems please consider using the following three options instead: 55 | .TP 56 | .B \-setuid user (Not available on Windows.) 57 | When started in privileged mode, drop down to user's rights as soon as possible. 58 | .TP 59 | .B \-setgid group (Not available on Windows.) 60 | When started in privileged mode, drop down to group's rights as soon as possible. 61 | .TP 62 | .B \-chroot dir (Not available on Windows.) 63 | When started in privileged mode, restrict file access to the specified directory. 64 | .TP 65 | .B \-setcon context (Not available on Windows.) 66 | Set SELinux context when all there is left to do are network I/O operations. 67 | In order to be able to combine with -chroot you will have to `mount --bind /proc /chrootdir/proc` 68 | .TP 69 | .B \-x password 70 | Specifies a password or passphrase to use. This will allow you to protect the proxy from use by others who don't know the password. It needs to be specified on both proxy and client. 71 | .TP 72 | .B \-f file 73 | Specifies a log file. If you specify -syslog, syslog is always used instead. 74 | .TP 75 | .B \-h 76 | Displays brief usage information. 77 | 78 | .SH EXAMPLES 79 | The following assumes that ptunnel is run as root, both on the proxy and client. To tunnel ssh connections from the client machine via a proxy running on proxy.pingtunnel.com to the computer login.domain.com, the following command line would be used: 80 | .TP 81 | .B ptunnel \-p proxy.pingtunnel.com \-lp 8000 \-da login.domain.com \-dp 22 82 | .PP 83 | An ssh connection to login.domain.com can now be established as follows: 84 | .TP 85 | .B ssh \-p 8000 localhost 86 | .PP 87 | If ssh complains about potential man-in-the-middle attacks, simply remove the offending key from the known_hosts file. The warning/error is expected if you have previously ssh'd to your local computer (i.e., ssh localhost), or you have used ptunnel to forward ssh connections to different hosts. 88 | 89 | Of course, for all of this to work, you need to start the proxy on your proxy-computer (proxy.pingtunnel.com). Doing this is very simple: 90 | 91 | .B ptunnel 92 | 93 | If you find that the proxy isn't working, you will need to enable packet capturing on the main network device. Currently this device is assumed to be an ethernet-device (i.e., ethernet or wireless). Packet capturing is enabled by giving the -c switch, and supplying the device name to capture packets on (for instance eth0 or en1). The same goes for the client. On Mac OS X, packet capturing must always be enabled (both for proxy and client), as resent packets won't be received otherwise. 94 | 95 | To protect yourself from others using your proxy, you can protect access to it with a password using the -x switch. The password is never sent in the clear, but keep in mind that it may be visible from tools like top or ps, which can display the command line used to start an application. 96 | 97 | .SH EXIT STATUS 98 | .B ptunnel 99 | does not exit until forced to do so by an interrupt (Ctrl-C) or if it crashes. 100 | .SH BUGS 101 | .B ptunnel 102 | currently does not handle packet capturing on network interfaces other than ethernet or wireless correctly. 103 | .SH AUTHORS AND CONTRIBUTORS 104 | Daniel Stoedle (daniels@cs.uit.no) 105 | 106 | Windows port: Mike Miller (mike@mikeage.net) 107 | 108 | SELinux support: Sebastien Raveau (sebastien.raveau@epita.fr) 109 | 110 | Patches: Joe McKenzie, Steffen Wendzel and StalkR. 111 | 112 | .SH LICENSE 113 | .B ptunnel 114 | is licensed under the BSD License. 115 | .SH AVAILABILITY 116 | .TP 117 | The ptunnel homepage is currently located here: 118 | http://www.cs.uit.no/~daniels/PingTunnel/ 119 | .TP 120 | The freshmeat project page is located here: 121 | http://freshmeat.net/projects/ptunnel/ 122 | .PP 123 | Please take the time to rate ptunnel if you find it useful. Thanks! 124 | -------------------------------------------------------------------------------- /ptunnel/ptunnel.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/ptunnel.c -------------------------------------------------------------------------------- /ptunnel/ptunnel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/ptunnel.h -------------------------------------------------------------------------------- /ptunnel/redhat/._ptunnel.spec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/redhat/._ptunnel.spec -------------------------------------------------------------------------------- /ptunnel/redhat/ptunnel.spec: -------------------------------------------------------------------------------- 1 | # $Id: $ 2 | # Authority: dries 3 | # Upstream: Daniel Stodle 4 | 5 | %define real_name PingTunnel 6 | 7 | Summary: Reliably tunnel TCP connections over ICMP packets 8 | Name: ptunnel 9 | Version: 0.70 10 | Release: 1.rf 11 | License: BSD 12 | Group: Applications/Internet 13 | URL: http://www.cs.uit.no/~daniels/PingTunnel/index.html 14 | 15 | Packager: Dries Verachtert 16 | Vendor: Dag Apt Repository, http://dag.wieers.com/apt/ 17 | 18 | Source: http://www.cs.uit.no/~daniels/PingTunnel/PingTunnel-%{version}.tar.gz 19 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 20 | 21 | BuildRequires: libpcap 22 | 23 | %description 24 | Ping Tunnel is a tool for reliably tunneling TCP connections over ICMP echo 25 | request and reply packets (commonly known as ping requests and replies). It 26 | is useful for evading firewalls that, for whatever reason, prevent outgoing 27 | TCP connections, but allow in- and outgoing ICMP packets. The tunnel works 28 | by having a proxy run on a machine ping-able from the inside of the 29 | firewall, with the client running on the local machine from which TCP access 30 | is required. 31 | 32 | %prep 33 | %setup -n %{real_name} 34 | 35 | %build 36 | %{__make} %{?_smp_mflags} 37 | 38 | %install 39 | %{__rm} -rf %{buildroot} 40 | %makeinstall mandir="%{buildroot}%{_mandir}/man8" 41 | 42 | %clean 43 | %{__rm} -rf %{buildroot} 44 | 45 | %files 46 | %defattr(-, root, root, 0755) 47 | %doc CHANGELOG LICENSE README web/ 48 | %doc %{_mandir}/man8/ptunnel.8* 49 | %{_bindir}/ptunnel 50 | 51 | %changelog 52 | * Wed Jan 12 2009 Michael Grigorev - 0.70 53 | - Updated to release 0.70. 54 | 55 | * Fri May 27 2005 Dag Wieers - 0.61-1 - 3200+/dag 56 | - Updated to release 0.61. 57 | 58 | * Sat Apr 30 2005 Dag Wieers - 0.60-1 59 | - Updated to release 0.60. 60 | 61 | * Mon Feb 21 2005 Dag Wieers - 0.55-1 62 | - Updated to release 0.55. 63 | 64 | * Sun Feb 06 2005 Dag Wieers - 0.54-1 65 | - Updated to release 0.54. 66 | 67 | * Mon Jan 03 2005 Dries Verachtert - 0.52-1 68 | - Updated to release 0.52 (Makefile patch applied by author). 69 | 70 | * Sun Jan 02 2005 Dries Verachtert - 0.51-1 71 | - Initial package. 72 | -------------------------------------------------------------------------------- /ptunnel/selinux/CVS/Entries: -------------------------------------------------------------------------------- 1 | /ptunnel.te/1.1/Mon Jun 22 08:09:46 2009// 2 | D 3 | -------------------------------------------------------------------------------- /ptunnel/selinux/CVS/Repository: -------------------------------------------------------------------------------- 1 | pingtunnel/selinux 2 | -------------------------------------------------------------------------------- /ptunnel/selinux/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:daniels@lgserv3.stud.cs.uit.no:/users/daniels/cvsroot 2 | -------------------------------------------------------------------------------- /ptunnel/selinux/ptunnel.te: -------------------------------------------------------------------------------- 1 | policy_module(ptunnel, 1.7) 2 | 3 | require { 4 | type initrc_t; 5 | type unconfined_t; 6 | type unlabeled_t; 7 | class tcp_socket { read write create connect }; 8 | class association recvfrom; 9 | class rawip_socket { write read }; 10 | } 11 | 12 | type ptunnel_t; 13 | domain_dyntrans_type(initrc_t) 14 | 15 | allow ptunnel_t self:tcp_socket { read write create connect }; 16 | allow ptunnel_t unconfined_t:rawip_socket { write read }; 17 | allow ptunnel_t unlabeled_t:association recvfrom; 18 | corenet_tcp_sendrecv_generic_if(ptunnel_t) 19 | corenet_tcp_sendrecv_ssh_port(ptunnel_t) 20 | corenet_raw_receive_generic_node(ptunnel_t) 21 | corenet_tcp_connect_ssh_port(ptunnel_t) 22 | corenet_tcp_sendrecv_lo_node(ptunnel_t) 23 | -------------------------------------------------------------------------------- /ptunnel/server.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | ptunnel -x $PASSWORD 3 | -------------------------------------------------------------------------------- /ptunnel/web/._index.html: -------------------------------------------------------------------------------- 1 | Mac OS X  2 RTEXT -------------------------------------------------------------------------------- /ptunnel/web/._setup.png: -------------------------------------------------------------------------------- 1 | Mac OS X  2 R -------------------------------------------------------------------------------- /ptunnel/web/packet-format.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/web/packet-format.png -------------------------------------------------------------------------------- /ptunnel/web/setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/ptunnel/web/setup.png -------------------------------------------------------------------------------- /restic/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | ENV RESTIC_VERSION=0.4.0 4 | 5 | RUN apk add --no-cache go git musl-dev openssl ca-certificates && \ 6 | wget https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic-${RESTIC_VERSION}.tar.gz && \ 7 | tar -xzvf restic-${RESTIC_VERSION}.tar.gz && \ 8 | cd restic-${RESTIC_VERSION} && \ 9 | go build build.go && \ 10 | ./build && \ 11 | mv restic /bin/restic && \ 12 | cd ../ && \ 13 | rm -rf restic-* && \ 14 | apk del -q go git musl-dev openssl && \ 15 | rm -rf /var/cache/apk/* 16 | -------------------------------------------------------------------------------- /shadowsocks-ubuntu/multi-user/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | MAINTAINER izuolan 3 | 4 | RUN apt-get -qq update && \ 5 | apt-get install -q -y wget build-essential python-pip python-m2crypto && \ 6 | apt-get clean && \ 7 | rm -rf /var/lib/apt/lists/* 8 | RUN pip install shadowsocks 9 | 10 | #add chacha20 11 | RUN wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz && \ 12 | tar zxf LATEST.tar.gz && \ 13 | cd libsodium* && \ 14 | ./configure && make -j2 && make install && \ 15 | ldconfig 16 | 17 | ADD shadowsocks.json /etc/ 18 | ADD start.sh /usr/local/bin/start.sh 19 | RUN chmod 755 /usr/local/bin/start.sh 20 | 21 | 22 | CMD ["sh", "-c", "start.sh"] 23 | #ENTRYPOINT ["/usr/local/bin/ssserver"] 24 | -------------------------------------------------------------------------------- /shadowsocks-ubuntu/multi-user/README.md: -------------------------------------------------------------------------------- 1 | #### Edit `/your-path/shadowsocks.json` in your local 2 | ``` 3 | { 4 | "server":"0.0.0.0", 5 | "local_address": "127.0.0.1", 6 | "local_port":1080, 7 | "port_password":{ 8 | "11216":"pass11216", 9 | "11217":"pass11217", 10 | "11218":"pass11218", 11 | "11219":"pass11219", 12 | "11220":"pass11220" 13 | }, 14 | "timeout":300, 15 | "method":"aes-256-cfb", 16 | "fast_open": false 17 | } 18 | 19 | ``` 20 | 21 | #### Run 22 | ``` 23 | docker run -d -v /your-path/shadowsocks.json:/etc/shadowsocks.json -p 11216-11220:11216-11220 zuolan/shadowsocks-multi-user 24 | ``` 25 | 26 | #### Test 27 | 28 | `docker ps -a` 29 | 30 | `docker logs [Container ID]` 31 | -------------------------------------------------------------------------------- /shadowsocks-ubuntu/multi-user/shadowsocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"0.0.0.0", 3 | "local_address": "127.0.0.1", 4 | "local_port":1080, 5 | "port_password":{ 6 | "1216":"pass1216", 7 | "1217":"pass1217", 8 | "1218":"pass1218", 9 | "1219":"pass1219", 10 | "1220":"pass1220" 11 | }, 12 | "timeout":300, 13 | "method":"aes-256-cfb", 14 | "fast_open": false 15 | } 16 | -------------------------------------------------------------------------------- /shadowsocks-ubuntu/multi-user/start.sh: -------------------------------------------------------------------------------- 1 | echo "========================================================================" 2 | echo " You can now connect to this ShadowSocks server:" 3 | cat /etc/shadowsocks.json 4 | echo " Please remember the password!" 5 | echo "========================================================================" 6 | 7 | ssserver -c /etc/shadowsocks.json 8 | -------------------------------------------------------------------------------- /shadowsocks-ubuntu/single-user/Dockerfile: -------------------------------------------------------------------------------- 1 | # About shadowsocks of Docker 2 | # 3 | # Version:1.0.1 4 | 5 | FROM ubuntu:14.04 6 | MAINTAINER Dubu Qingfeng <1135326346@qq.com> 7 | 8 | ENV REFRESHED_AT 2015-06-05 9 | 10 | RUN apt-get -qq update && \ 11 | apt-get install -q -y wget build-essential python-pip python-m2crypto && \ 12 | apt-get clean && \ 13 | rm -rf /var/lib/apt/lists/* 14 | RUN pip install shadowsocks 15 | 16 | ENV SS_SERVER_ADDR 0.0.0.0 17 | ENV SS_SERVER_PORT 8388 18 | ENV SS_PASSWORD password 19 | ENV SS_METHOD aes-256-cfb 20 | ENV SS_TIMEOUT 300 21 | 22 | #add chacha20 23 | RUN wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz && \ 24 | tar zxf LATEST.tar.gz && \ 25 | cd libsodium* && \ 26 | ./configure && make -j2 && make install && \ 27 | ldconfig 28 | 29 | ADD shadowsocks.json /etc/ 30 | ADD start.sh /usr/local/bin/start.sh 31 | RUN chmod 755 /usr/local/bin/start.sh 32 | 33 | EXPOSE $SS_SERVER_PORT 34 | 35 | CMD ["sh", "-c", "start.sh"] 36 | #ENTRYPOINT ["/usr/local/bin/ssserver"] 37 | -------------------------------------------------------------------------------- /shadowsocks-ubuntu/single-user/README.md: -------------------------------------------------------------------------------- 1 | 基于ubuntu的shadowsocks的Docker镜像 2 | 3 | **以下部分与这仓库无关,下面部分是已经构建好的部署说明,可以直接执行部署** 4 | 5 | ##部署说明 6 | 7 | 1.安装并测试Docker,可以参考官方文档。或者是《Docker入门与实践》安装一节。 8 | 9 | 2.拉取镜像 10 | 11 | `docker pull index.alauda.cn/dubuqingfeng/ubuntu-shadowsocks:vps` 12 | 13 | 3.运行容器 14 | 15 | `docker run -d -p 1984:1984 index.alauda.cn/dubuqingfeng/ubuntu-shadowsocks:vps -p 1984 -k sspassword -m aes-256-cfb` 16 | 17 | 3.测试运行 18 | 19 | `docker ps -a` 20 | 21 | 如果出现up即为安装成功。 22 | 23 | ##配置说明 24 | 25 | `docker run -d -p 1984:1984 index.alauda.cn/dubuqingfeng/ubuntu-shadowsocks:vps -p 1984 -k sspassword -m aes-256-cfb` 26 | 27 | 1984即为服务器端口。 28 | 29 | sspassword为连接密码,自行更换。 30 | 31 | aes-256-cfb为加密方式。 32 | 33 | 也可以使用`-c /etc/shadowsocks.json`参数。 34 | -------------------------------------------------------------------------------- /shadowsocks-ubuntu/single-user/shadowsocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "server":"0.0.0.0", 3 | "server_port":1984, 4 | "local_address": "127.0.0.1", 5 | "local_port":1080, 6 | "password":"sspassword", 7 | "timeout":300, 8 | "method":"aes-256-cfb", 9 | "fast_open": false 10 | } 11 | -------------------------------------------------------------------------------- /shadowsocks-ubuntu/single-user/start.sh: -------------------------------------------------------------------------------- 1 | echo "========================================================================" 2 | echo " You can now connect to this ShadowSocks server:" 3 | echo " server: $SS_SERVER_ADDR port: $SS_SERVER_PORT password: $SS_PASSWORD " 4 | echo " timeout: $SS_TIMEOUT encryption method: $SS_METHOD " 5 | echo " Please remember the password!" 6 | echo "========================================================================" 7 | 8 | ssserver -s $SS_SERVER_ADDR -p $SS_SERVER_PORT -k $SS_PASSWORD -m $SS_METHOD -t $SS_TIMEOUT 9 | -------------------------------------------------------------------------------- /shadowsocksr/README.md: -------------------------------------------------------------------------------- 1 | 现在比较主流的方案可能就是SSR+kcptun了,基本上都能流畅看1080P的youtube了。下面讲述如何快速搭建服务端和客户端(主要针对osx和unix,win上有成熟的GUI方案) 2 | 3 | ## 服务端 4 | SSR一键安装包(引用自https://www.91yun.org/archives/2079) 5 | ``` 6 | wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/shadowsocks_install/master/shadowsocksR.sh && bash shadowsocksR.sh 7 | ``` 8 | #### [kcptun](https://github.com/xtaci/kcptun) 9 | `https://github.com/xtaci/kcptun/releases`下载适合自己系统的最新版本`tar -xf`解压得到server_linux_amd64.执行服务端.摘录文档如下 10 | ``` 11 | 服务器: ./server_linux_amd64 -t "127.0.0.1:8388" -l ":4000" -mode fast2 // 转发到服务器的本地8388端口 12 | 客户端: ./client_darwin_amd64 -r "服务器IP地址:4000" -l ":8388" -mode fast2 // 监听客户端的本地8388端口 13 | 注: 服务器端需要有服务监听8388端口 14 | ``` 15 | !!! 很重要的就是端口。可能参数填写的比较多一不小心容易被混淆,kcptun作为后台运行程序可以简单的 16 | `nohup command &` 17 | 18 | ## 使用docker 19 | 我个人比较喜欢用docker,想想优势可能有这2个方面。docker logs看日志比较方便.docker的开机启动项也比较友好,特别是相对于osx的plist.另外docker官方支持最低版本为3.1。openvz的内核绝大多数都是2.6.32,所以你的如果购买的是openvz的vps的话那么docker在服务端是无法使用的.强烈建议在电脑客户端使用docker 20 | 快速使用步骤 21 | 22 | 1. 根据[官方文档](https://docs.docker.com)安装docker和docker-compose,在本机设置dockerhub镜像源,推荐使用中科大https://docker.mirrors.ustc.edu.cn ,[镜像设置帮助文档](https://lug.ustc.edu.cn/wiki/mirrors/help/docker) 23 | 2. git clone本gist修改ip及端口(修改成自己的ip,密码以及喜欢的端口),需修改ssr.json,server_docker_compose.yaml,client_docker_compose.yaml 24 | 3. 服务端在server_docker_compose.yaml目录执行 25 | ``` 26 | docker-compose -f server_docker_compose.yaml up --build -d 27 | ``` 28 | 4. 客户端在client_docker_compose.yaml目录执行 29 | ``` 30 | docker-compose -f client_docker_compose.yaml up --build -d 31 | ``` 32 | 如此就搞定了一个ssr+kcptun的socks5代理了 33 | 34 | ## 额外 35 | 1. socks5代理虽好,可是有时候我们会需要http代理.这时果断装上privoxy。最简单的设置如下 36 | 37 | ``` 38 | #osx为例 39 | brew install privoxy(brew info privoxy) 40 | echo -n forward-socks5 / localhost:1083 . >> /usr/local/etc/privoxy/config 41 | # 这样我们就有了一个端口为8118(privoxy默认)的http代理了,转发到我们搭建好的socks5代理 42 | launchctl load ~/Library/LaunchAgents/homebrew.mxcl.privoxy.plist 43 | ``` 44 | 45 | 2. unix的世界里http_proxy这种环境变量是相当好用靠谱的,比如curl,wget,httpie超级多的命令行工具都认这种环境变量。可是如果你要是写死。。。。。那么当你不需要代理的时候又会悲催了,写个shell辅助下(switch proxy)sp是设置代理sp -是取消环境变量 46 | 47 | ``` 48 | function sp(){ 49 | if [ -n "$1" ]; 50 | then 51 | echo "unset proxy" 52 | unset {http,https,ftp}_proxy 53 | unset {HTTP,HTTPS,FTP}_PROXY 54 | else 55 | echo "set proxy"; 56 | export {http,https,ftp}_proxy="http://127.0.0.1:8118" 57 | export {HTTP,HTTPS,FTP}_PROXY="http://127.0.0.1:8118" 58 | fi 59 | } 60 | ``` 61 | 62 | 3. 对于日常浏览器用pac进行分流没啥好说的,我本人使用chrome+SwitchyOmega配合这个pac规则[https://raw.githubusercontent.com/calfzhou/autoproxy-gfwlist/master/gfwlist.txt](https://raw.githubusercontent.com/calfzhou/autoproxy-gfwlist/master/gfwlist.txt) 63 | 4. 如果你一心想使用safari,像GUI那样设置pac或者全局socket.可以用以下shell脚本。ss设置pac,ss加任意字符设置成全局socks5,ss c取消代理设置.注意,因为networksetup需要root权限。执行sudo visudo -f /etc/sudoers加入`your_name ALL=(root) NOPASSWD: /usr/sbin/networksetup` 64 | 65 | ``` 66 | function ss(){ 67 | case $1 in 68 | c|C) 69 | echo "clean proxy" 70 | sudo networksetup -setautoproxyurl "Wi-Fi" " " 71 | sudo networksetup -setautoproxystate "Wi-Fi" off 72 | sudo networksetup -setsocksfirewallproxy "Wi-Fi" "" "" 73 | sudo networksetup -setsocksfirewallproxystate "Wi-Fi" off 74 | ;; 75 | "") 76 | echo "pac"; 77 | sudo networksetup -setsocksfirewallproxy "Wi-Fi" "" "" 78 | sudo networksetup -setsocksfirewallproxystate "Wi-Fi" off 79 | sudo networksetup -setautoproxyurl "Wi-Fi" "http://127.0.0.1:1088/proxy.pac" 80 | ;; 81 | *) 82 | echo "global socks5 proxy" 83 | sudo networksetup -setautoproxyurl "Wi-Fi" " " 84 | sudo networksetup -setautoproxystate "Wi-Fi" off 85 | sudo networksetup -setsocksfirewallproxy "Wi-Fi" '127.0.0.1' '1085' 86 | esac 87 | } 88 | ``` 89 | 90 | 5. kcptun现在还不是特别成熟,有可能会发生突然断流的现象,当你觉得不耐烦的时候,重启一下容器可能是个不错的选择-_-`alias dr='docker-compose -f /abs_path/client_docker_compose.yaml restart'` 91 | 6. kcptun对不同的网络需要自己进行一些调试才会取得很好的效果,最差的情况有可能会出现套上kcptun比单独使用ssr速度糟糕的情况,[查看讨论:手动参数设定探讨](https://github.com/xtaci/kcptun/issues/137) 92 | 7. 如果你有迅雷快鸟的会员,可以验证下是否能对你的宽带进行加速。如果能,那么请用[Xunlei-Fastdick](https://github.com/fffonion/Xunlei-Fastdick)`docker run -d --name=xunlei-fastdick --restart=always -e XUNLEI_UID= -e XUNLEI_PASSWD= flier/xunlei-fastdick` 93 | 8. win目前没有kcptun的客户端,脚本参照http://k162.space/kcptun/ 94 | 9. 如果有任何建议或疑问请留言~~ -------------------------------------------------------------------------------- /shadowsocksr/client_docker_compose.yaml: -------------------------------------------------------------------------------- 1 | ssr: 2 | restart: always 3 | build: . 4 | dockerfile: ./ssr_Dockerfile 5 | container_name: ssr 6 | command: sh -c "python -m SimpleHTTPServer 1088 & sslocal -s kcptun -c /etc/ssr.json -v" 7 | volumes: 8 | - ./:/etc 9 | - ./proxy.pac:/proxy.pac 10 | ports: 11 | - "1083:1083" 12 | - "1088:1088" 13 | links: 14 | - kcptun 15 | kcptun: 16 | restart: always 17 | build: . 18 | dockerfile: ./kcp_Dockerfile 19 | container_name: kcptun 20 | # command: server_linux_amd64 -t "127.0.0.1:8086" -l ":9758" 21 | command: client_linux_amd64 -r 'vps_ip:9758' -l ':8086' -mode manual -nodelay 1 -resend 2 -nc 1 -interval 20 22 | environment: 23 | KCPTUN_KEY: "please_change_me_tooooooolong" 24 | ports: 25 | - "9758:9758/udp" 26 | -------------------------------------------------------------------------------- /shadowsocksr/kcp_Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.4 2 | 3 | RUN if [ $(wget -qO- ipinfo.io/country) == CN ]; then echo "http://mirrors.ustc.edu.cn/alpine/v3.4/main/" > /etc/apk/repositories ;fi \ 4 | && apk update && apk add --no-cache ca-certificates wget && update-ca-certificates 5 | 6 | RUN downloadurl=`wget -qO- https://github.com/xtaci/kcptun/releases | sed -n 's/.*href="\([^"]*\).*/\1/p' | grep -m 1 linux-amd64` \ 7 | && wget -q "https://github.com""$downloadurl" -O kcptun && tar -xf kcptun -C /usr/bin && rm kcptun 8 | -------------------------------------------------------------------------------- /shadowsocksr/server_docker_compose.yaml: -------------------------------------------------------------------------------- 1 | ssr: 2 | restart: always 3 | build: . 4 | dockerfile: ./ssr_Dockerfile 5 | container_name: ssr 6 | command: ssserver -c /etc/ssr.json -v 7 | volumes: 8 | - ./:/etc 9 | ports: 10 | - "8086:8086" 11 | kcptun: 12 | restart: always 13 | build: . 14 | dockerfile: ./kcp_Dockerfile 15 | container_name: kcptun 16 | ports: 17 | - "9758:9758/udp" 18 | command: sh -c "server_linux_amd64 -t 'ssr:8086' -l ':9758' -mode manual -nodelay 1 -resend 2 -nc 1 -interval 20" 19 | environment: 20 | KCPTUN_KEY: "please_change_me_tooooooolong" 21 | links: 22 | - ssr -------------------------------------------------------------------------------- /shadowsocksr/ssr.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": "0.0.0.0", 3 | "server_ipv6": "::", 4 | "server_port": 8086, 5 | "local_address": "0.0.0.0", 6 | "local_port": 1083, 7 | "password": "pppppppppppppppppppppppppppddddddddddddddddddddd", 8 | "timeout": 120, 9 | "udp_timeout": 60, 10 | "method": "chacha20", 11 | "protocol": "auth_sha1_compatible", 12 | "protocol_param": "", 13 | "obfs": "http_simple_compatible", 14 | "obfs_param": "", 15 | "dns_ipv6": false, 16 | "connect_verbose_info": 0, 17 | "redirect": "", 18 | "fast_open": false, 19 | "workers": 1 20 | } -------------------------------------------------------------------------------- /shadowsocksr/ssr_Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.4 2 | 3 | RUN if [ $(wget -qO- ipinfo.io/country) == CN ]; then echo "http://mirrors.ustc.edu.cn/alpine/v3.4/main/" > /etc/apk/repositories ;fi \ 4 | && apk update && apk upgrade \ 5 | && apk add --no-cache git py-pip libsodium 6 | 7 | RUN pip install --no-cache-dir git+https://github.com/breakwa11/shadowsocks.git@manyuser -------------------------------------------------------------------------------- /shellinabox/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | MAINTAINER izuolan 3 | 4 | RUN apt-get update && apt-get install shellinabox 5 | 6 | # a new user is needed to get access to the container 7 | RUN useradd username 8 | RUN echo "username:userpassword" | chpasswd 9 | 10 | #this is needed to gain root access 11 | RUN echo "root:rootpassword" | chpasswd 12 | 13 | EXPOSE 4200 14 | 15 | CMD ["shellinaboxd", "-s", "/:LOGIN", "--disable-ssl"] 16 | -------------------------------------------------------------------------------- /shellinabox/README.md: -------------------------------------------------------------------------------- 1 | #### BUILD 2 | `docker build -t shellinabox .` 3 | #### RUN 4 | `docker run -d -p 4200:4200 --name=shellinabox shellinabox` 5 | -------------------------------------------------------------------------------- /ssdb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine as build 2 | 3 | ARG VERSION=${VERSION:-master} 4 | 5 | RUN apk add --no-cache \ 6 | curl tar \ 7 | gcc g++ make autoconf \ 8 | libc-dev libevent-dev linux-headers perl \ 9 | && mkdir -p /ssdb/tmp \ 10 | && curl -Lk "https://github.com/ideawu/ssdb/archive/${VERSION}.tar.gz" | \ 11 | tar -xz -C /ssdb/tmp --strip-components=1 \ 12 | && cd /ssdb/tmp \ 13 | && make -j$(getconf _NPROCESSORS_ONLN) \ 14 | && make install PREFIX=/ssdb \ 15 | && sed -e "s@home.*@home $(dirname /ssdb/var)@" \ 16 | -e "s/loglevel.*/loglevel info/" \ 17 | -e "s@work_dir = .*@work_dir = /ssdb/var@" \ 18 | -e "s@pidfile = .*@pidfile = /run/ssdb.pid@" \ 19 | -e "s@output:.*@output: stdout@" \ 20 | -e "s@level:.*@level: info@" \ 21 | -e "s@ip:.*@ip: 0.0.0.0@" \ 22 | -i /ssdb/ssdb.conf \ 23 | && rm -rf /ssdb/tmp 24 | 25 | FROM alpine 26 | 27 | RUN apk add --no-cache libstdc++ 28 | 29 | COPY --from=build /ssdb/ /ssdb/ 30 | 31 | EXPOSE 8890 32 | VOLUME /ssdb/var 33 | 34 | CMD ["/ssdb/ssdb-server", "/ssdb/ssdb.conf"] -------------------------------------------------------------------------------- /ssdb/README.md: -------------------------------------------------------------------------------- 1 | #### [zuolan/ssdb](https://hub.docker.com/r/zuolan/ssdb/) 2 | 3 | - Port: 8890 4 | - Volume: /ssdb/var 5 | - Config: /ssdb/ssdb.conf 6 | 7 | via Docker: 8 | 9 | ```shell 10 | $ docker pull zuolan/ssdb 11 | $ docker run -d --name ssdb -p 8890:8890 \ 12 | -v /path/ssdb/var:/ssdb/var \ 13 | -v /path/ssdb/ssdb.conf:/ssdb/ssdb.conf:ro \ 14 | --restart=always zuolan/ssdb 15 | ``` 16 | 17 | via Docker-Compose: 18 | 19 | ```shell 20 | $ docker-compose up -d 21 | ``` 22 | -------------------------------------------------------------------------------- /ssdb/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | ssdb: 6 | image: zuolan/ssdb 7 | # container_name: ssdb 8 | restart: always 9 | volumes: 10 | - ./var:/ssdb/var 11 | - ./ssdb.conf:/ssdb/ssdb.conf:ro 12 | ports: 13 | - 8890:8890 14 | networks: 15 | - ssdb-net 16 | 17 | networks: 18 | ssdb-net: 19 | driver: bridge -------------------------------------------------------------------------------- /ssdb/ssdb.conf: -------------------------------------------------------------------------------- 1 | # ssdb-server config 2 | # MUST indent by TAB! 3 | 4 | # relative to path of this file, directory must exists 5 | work_dir = /ssdb/var 6 | pidfile = /run/ssdb.pid 7 | 8 | server: 9 | #ip: 127.0.0.1 10 | port: 8890 11 | # bind to public ip 12 | ip: 0.0.0.0 13 | # format: allow|deny: all|ip_prefix 14 | # multiple allows or denys is supported 15 | #deny: all 16 | allow: 127.0.0.1 17 | allow: 192.168 18 | allow: 10.30.143 19 | # auth password must be at least 32 characters 20 | #auth: very-strong-password 21 | #readonly: yes 22 | 23 | replication: 24 | binlog: yes 25 | # Limit sync speed to *MB/s, -1: no limit 26 | sync_speed: -1 27 | slaveof: 28 | # to identify a master even if it moved(ip, port changed) 29 | # if set to empty or not defined, ip:port will be used. 30 | #id: svc_2 31 | # sync|mirror, default is sync 32 | #type: sync 33 | #host: localhost 34 | #port: 8889 35 | 36 | logger: 37 | #level: debug 38 | #output: log.txt 39 | level: info 40 | output: stdout 41 | rotate: 42 | size: 1000000000 43 | 44 | leveldb: 45 | # in MB 46 | cache_size: 1500 47 | # in MB 48 | write_buffer_size: 128 49 | # in MB/s 50 | compaction_speed: 1000 51 | # yes|no 52 | compression: yes -------------------------------------------------------------------------------- /tensorflow-go/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tensorflow/tensorflow 2 | 3 | ENV GOLANG_VERSION 1.8.3 4 | ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz 5 | ENV GOLANG_DOWNLOAD_SHA256 1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 6 | # Set up golang 7 | ENV GOPATH /go 8 | ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH 9 | 10 | RUN apt-get update && apt-get install -y --no-install-recommends \ 11 | # Install gcc for cgo 12 | g++ \ 13 | gcc \ 14 | libc6-dev \ 15 | make \ 16 | pkg-config \ 17 | # Notebook Dependencies 18 | libzmq3-dev \ 19 | build-essential \ 20 | python3-pip \ 21 | git && \ 22 | rm -rf /var/lib/apt/lists/* && \ 23 | curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \ 24 | echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \ 25 | tar -C /usr/local -xzf golang.tar.gz && \ 26 | rm golang.tar.gz && \ 27 | mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" && \ 28 | curl -fsSL https://git.io/vDyrl -o /usr/local/bin/go-wrapper && \ 29 | # Install Gophernotes 30 | go get golang.org/x/tools/cmd/goimports && \ 31 | go get -tags zmq_3_x github.com/gopherds/gophernotes && \ 32 | mkdir -p ~/.ipython/kernels/gophernotes && \ 33 | cp -r $GOPATH/src/github.com/gopherds/gophernotes/kernel/* ~/.ipython/kernels/gophernotes && \ 34 | mv /notebooks/* /go 35 | 36 | # TensorBoard 37 | EXPOSE 6006 38 | # IPython 39 | EXPOSE 8888 40 | 41 | WORKDIR "/go" 42 | 43 | CMD ["/run_jupyter.sh", "--allow-root"] 44 | -------------------------------------------------------------------------------- /tensorflow-go/Dockerfile.py3: -------------------------------------------------------------------------------- 1 | FROM tensorflow/tensorflow 2 | 3 | ENV GOLANG_VERSION 1.7.5 4 | ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz 5 | ENV GOLANG_DOWNLOAD_SHA256 2e4dd6c44f0693bef4e7b46cc701513d74c3cc44f2419bf519d7868b12931ac3 6 | # Set up golang 7 | ENV GOPATH /go 8 | ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH 9 | 10 | RUN apt-get update && apt-get install -y --no-install-recommends \ 11 | # Install gcc for cgo 12 | g++ \ 13 | gcc \ 14 | libc6-dev \ 15 | make \ 16 | pkg-config \ 17 | # Notebook Dependencies 18 | libzmq3-dev \ 19 | build-essential \ 20 | python3-pip \ 21 | git && \ 22 | rm -rf /var/lib/apt/lists/* && \ 23 | curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \ 24 | echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \ 25 | tar -C /usr/local -xzf golang.tar.gz && \ 26 | rm golang.tar.gz && \ 27 | mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" && \ 28 | curl -fsSL https://git.io/vDyrl -o /usr/local/bin/go-wrapper && \ 29 | # Install Gophernotes 30 | go get golang.org/x/tools/cmd/goimports && \ 31 | go get -tags zmq_3_x github.com/gopherds/gophernotes && \ 32 | mkdir -p ~/.ipython/kernels/gophernotes && \ 33 | cp -r $GOPATH/src/github.com/gopherds/gophernotes/kernel/* ~/.ipython/kernels/gophernotes && \ 34 | mv /notebooks/* /go 35 | COPY get-pip.py /get-pip.py 36 | RUN python3 /get-pip.py && \ 37 | pip install --upgrade pip && \ 38 | python3 -m pip install ipykernel && \ 39 | python3 -m ipykernel install --user 40 | 41 | # TensorBoard 42 | EXPOSE 6006 43 | # IPython 44 | EXPOSE 8888 45 | 46 | WORKDIR "/go" 47 | 48 | CMD ["/run_jupyter.sh"] 49 | -------------------------------------------------------------------------------- /typecho/Caddyfile: -------------------------------------------------------------------------------- 1 | 0.0.0.0 2 | 3 | browse 4 | 5 | fastcgi / 127.0.0.1:9000 php 6 | 7 | startup php-fpm 8 | 9 | log stdout 10 | 11 | errors stdout 12 | -------------------------------------------------------------------------------- /typecho/Dockerfile.beta: -------------------------------------------------------------------------------- 1 | FROM alpine:3.4 2 | MAINTAINER Zuo Lan 3 | 4 | RUN apk add --update --no-cache \ 5 | php5-fpm \ 6 | sqlite \ 7 | curl \ 8 | git \ 9 | php5-pdo_sqlite \ 10 | php5-ctype \ 11 | php5-curl \ 12 | php5-iconv \ 13 | php5-json \ 14 | && echo "clear_env = no" >> /etc/php5/php-fpm.conf \ 15 | && curl --silent --show-error --fail --location \ 16 | --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ 17 | "https://caddyserver.com/download/build?os=linux&arch=amd64" \ 18 | | tar --no-same-owner -C /usr/bin/ -xz caddy \ 19 | && chmod 0755 /usr/bin/caddy \ 20 | && /usr/bin/caddy -version \ 21 | && apk del curl git 22 | 23 | WORKDIR /srv 24 | EXPOSE 80 443 2015 25 | ADD Caddyfile /etc/caddy/Caddyfile 26 | VOLUME ["/srv/","/etc/caddy/"] 27 | 28 | ENTRYPOINT ["/usr/bin/caddy"] 29 | CMD ["--conf", "/etc/caddy/Caddyfile"] 30 | -------------------------------------------------------------------------------- /typecho/Dockerfile.caddy: -------------------------------------------------------------------------------- 1 | FROM alpine:3.4 2 | MAINTAINER Zuo Lan 3 | 4 | RUN apk add --update --no-cache \ 5 | ca-certificates \ 6 | openssl \ 7 | php5-fpm \ 8 | sqlite \ 9 | curl \ 10 | git \ 11 | php5-pdo \ 12 | php5-pdo_sqlite \ 13 | php5-sqlite3 \ 14 | php5-ctype \ 15 | php5-curl \ 16 | php5-dom \ 17 | php5-gd \ 18 | php5-iconv \ 19 | php5-json \ 20 | php5-xml \ 21 | php5-mcrypt \ 22 | php5-openssl \ 23 | php5-posix \ 24 | php5-sockets \ 25 | php5-zip \ 26 | && echo "clear_env = no" >> /etc/php5/php-fpm.conf \ 27 | && curl --silent --show-error --fail --location \ 28 | --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ 29 | "https://caddyserver.com/download/build?os=linux&arch=amd64" \ 30 | | tar --no-same-owner -C /usr/bin/ -xz caddy \ 31 | && chmod 0755 /usr/bin/caddy \ 32 | && /usr/bin/caddy -version 33 | 34 | WORKDIR /srv 35 | EXPOSE 80 443 2015 36 | ADD Caddyfile /etc/caddy/Caddyfile 37 | VOLUME ["/srv/","/etc/caddy/"] 38 | 39 | ENTRYPOINT ["/usr/bin/caddy"] 40 | CMD ["--conf", "/etc/caddy/Caddyfile"] 41 | -------------------------------------------------------------------------------- /typecho/Dockerfile.nginx: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | MAINTAINER Zuo Lan 3 | 4 | RUN apk add --update --no-cache \ 5 | ca-certificates \ 6 | openssl \ 7 | php5-fpm \ 8 | sqlite \ 9 | supervisor \ 10 | curl \ 11 | git \ 12 | php5-pdo \ 13 | php5-pdo_sqlite \ 14 | php5-sqlite3 \ 15 | php5-ctype \ 16 | php5-curl \ 17 | php5-dom \ 18 | php5-gd \ 19 | php5-iconv \ 20 | php5-json \ 21 | php5-xml \ 22 | php5-mcrypt \ 23 | php5-openssl \ 24 | php5-posix \ 25 | php5-sockets \ 26 | php5-zip \ 27 | && echo "clear_env = no" >> /etc/php5/php-fpm.conf 28 | 29 | EXPOSE 80 443 30 | WORKDIR /usr/share/nginx/html 31 | COPY nginx.conf /etc/nginx/conf.d/default.conf 32 | COPY supervisord.conf /etc/supervisord.conf 33 | VOLUME ["/usr/share/nginx/html","/etc/nginx/conf.d/"] 34 | CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"] 35 | # CMD ["nginx", "-g", "daemon off;"] 36 | -------------------------------------------------------------------------------- /typecho/README.md: -------------------------------------------------------------------------------- 1 | [Dockerfile](https://github.com/izuolan/dockerfiles/tree/master/typecho) 2 | 3 | ## 安装 4 | * 第一步:克隆 Typecho 仓库 5 | ``` 6 | git clone https://github.com/typecho/typecho.git ~/app/ 7 | ``` 8 | 没把 Typecho 放进镜像只是为了减少体积,方便更新罢了。 9 | 10 | * 第二步:启动容器,同时修改目录权限,避免安装异常 11 | 端口`9090`可以修改,数据卷修改的话,记得下面路径也要修改为一样的。 12 | ``` 13 | docker run --name=blog --restart=always -d -v ~/app:/srv/ -p 9090:2015 zuolan/typecho && chmod 777 ~/app/usr && chmod 777 ~/app 14 | ``` 15 | 然后打开网页一路安装完成。 16 | 17 | ## 使用 HTTPS 18 | 获取证书之后,使用命令进入容器: 19 | ``` 20 | docker exec -it blog sh 21 | ``` 22 | 编辑文件: 23 | ``` 24 | vi config.inc.php 25 | ``` 26 | 添加一行`define('__TYPECHO_SECURE__',true);` 27 | 保存,使用`exit`退出容器,然后重启容器: 28 | ``` 29 | docker restart blog 30 | ```` 31 | 32 | #### Build 33 | `docker build -t yourname/typecho .` 34 | 35 | -------------------------------------------------------------------------------- /typecho/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name localhost; 4 | 5 | #charset koi8-r; 6 | #access_log /var/log/nginx/log/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | index index.html index.htm; 11 | } 12 | 13 | #error_page 404 /404.html; 14 | 15 | # redirect server error pages to the static page /50x.html 16 | # 17 | error_page 500 502 503 504 /50x.html; 18 | location = /50x.html { 19 | root /usr/share/nginx/html; 20 | } 21 | 22 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 23 | # 24 | #location ~ \.php$ { 25 | # proxy_pass http://127.0.0.1; 26 | #} 27 | 28 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 29 | # 30 | #location ~ \.php$ { 31 | # root html; 32 | # fastcgi_pass 127.0.0.1:9000; 33 | # fastcgi_index index.php; 34 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 35 | # include fastcgi_params; 36 | #} 37 | 38 | # deny access to .htaccess files, if Apache's document root 39 | # concurs with nginx's one 40 | # 41 | #location ~ /\.ht { 42 | # deny all; 43 | #} 44 | } 45 | -------------------------------------------------------------------------------- /typecho/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/dev/shm/supervisor.sock ; (the path to the socket file) 3 | 4 | [supervisord] 5 | logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log) 6 | logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) 7 | logfile_backups=10 ; (num of main logfile rotation backups;default 10) 8 | loglevel=info ; (log level;default info; others: debug,warn,trace) 9 | pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 10 | nodaemon=false ; (start in foreground if true;default false) 11 | minfds=1024 ; (min. avail startup file descriptors;default 1024) 12 | minprocs=200 ; (min. avail process descriptors;default 200) 13 | user=root ; 14 | 15 | ; the below section must remain in the config file for RPC 16 | ; (supervisorctl/web interface) to work, additional interfaces may be 17 | ; added by defining them in separate rpcinterface: sections 18 | [rpcinterface:supervisor] 19 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 20 | 21 | [supervisorctl] 22 | serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL for a unix socket 23 | 24 | [program:php-fpm] 25 | command = /usr/bin/php-fpm -c /etc/php5 26 | autostart=true 27 | autorestart=true 28 | priority=5 29 | stdout_logfile=/dev/stdout 30 | stdout_logfile_maxbytes=0 31 | stderr_logfile=/dev/stderr 32 | stderr_logfile_maxbytes=0 33 | 34 | [program:nginx] 35 | command=/usr/sbin/nginx 36 | autostart=true 37 | autorestart=true 38 | priority=10 39 | stdout_events_enabled=true 40 | stderr_events_enabled=true 41 | stdout_logfile=/dev/stdout 42 | stdout_logfile_maxbytes=0 43 | stderr_logfile=/dev/stderr 44 | stderr_logfile_maxbytes=0 45 | -------------------------------------------------------------------------------- /uploads/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | MAINTAINER ZuoLan 3 | 4 | RUN apt-get update && \ 5 | apt-get -y install \ 6 | nginx \ 7 | ca-certificates \ 8 | php5 php5-fpm php5-cli php5-json php5-curl 9 | 10 | RUN mkdir /www 11 | WORKDIR /www 12 | ADD script /www 13 | VOLUME /www/uploads 14 | 15 | ADD nginx.conf /etc/nginx/nginx.conf 16 | 17 | RUN apt-get autoremove -y && \ 18 | apt-get autoclean -y && \ 19 | apt-get clean -y && \ 20 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 21 | 22 | CMD ["sh", "-c", "chown -R www-data: /www && service php5-fpm start && nginx"] 23 | -------------------------------------------------------------------------------- /uploads/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes 4; 3 | pid /run/nginx.pid; 4 | daemon off; 5 | 6 | events { 7 | worker_connections 768; 8 | # multi_accept on; 9 | } 10 | 11 | http { 12 | 13 | ## 14 | # Basic Settings 15 | ## 16 | 17 | sendfile on; 18 | tcp_nopush on; 19 | tcp_nodelay on; 20 | keepalive_timeout 65; 21 | types_hash_max_size 2048; 22 | # server_tokens off; 23 | 24 | # server_names_hash_bucket_size 64; 25 | # server_name_in_redirect off; 26 | 27 | include /etc/nginx/mime.types; 28 | default_type application/octet-stream; 29 | 30 | ## 31 | # Logging Settings 32 | ## 33 | 34 | access_log /var/log/nginx/access.log; 35 | error_log /var/log/nginx/error.log; 36 | 37 | ## 38 | # Gzip Settings 39 | ## 40 | 41 | gzip on; 42 | gzip_disable "msie6"; 43 | 44 | gzip_vary on; 45 | gzip_proxied any; 46 | gzip_comp_level 6; 47 | gzip_buffers 16 8k; 48 | gzip_http_version 1.1; 49 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 50 | 51 | server { 52 | root /www; 53 | location / { 54 | try_files $uri $uri/ /index.php?$args; 55 | index index.html index.htm index.php; 56 | } 57 | location ~ \.php$ { 58 | try_files $uri $uri/ /index.php?$args; 59 | index index.html index.htm index.php; 60 | include fastcgi_params; 61 | fastcgi_index index.php; 62 | fastcgi_param PATH_INFO $fastcgi_path_info; 63 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 64 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 65 | fastcgi_param HTTP_MOD_REWRITE On; 66 | fastcgi_pass unix:/var/run/php5-fpm.sock; 67 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 68 | } 69 | } 70 | } 71 | 72 | -------------------------------------------------------------------------------- /uploads/script/assets/css/style.css: -------------------------------------------------------------------------------- 1 | /*------------------------- 2 | Simple reset 3 | --------------------------*/ 4 | 5 | 6 | *{ 7 | margin:0; 8 | padding:0; 9 | } 10 | 11 | 12 | /*------------------------- 13 | General Styles 14 | --------------------------*/ 15 | 16 | 17 | html{ 18 | background-color:#ebebec; 19 | 20 | background-image:-webkit-radial-gradient(center, #ebebec, #b4b4b4); 21 | background-image:-moz-radial-gradient(center, #ebebec, #b4b4b4); 22 | background-image:radial-gradient(center, #ebebec, #b4b4b4); 23 | 24 | min-height:900px; 25 | } 26 | 27 | body{ 28 | font:15px/1.3 Arial, sans-serif; 29 | color: #4f4f4f; 30 | } 31 | 32 | a, a:visited { 33 | outline:none; 34 | color:#389dc1; 35 | } 36 | 37 | a:hover{ 38 | text-decoration:none; 39 | } 40 | 41 | section, footer, header, aside{ 42 | display: block; 43 | } 44 | 45 | 46 | /*---------------------------- 47 | The file upload form 48 | -----------------------------*/ 49 | 50 | 51 | #upload{ 52 | font-family:'PT Sans Narrow', sans-serif; 53 | background-color:#373a3d; 54 | 55 | background-image:-webkit-linear-gradient(top, #373a3d, #313437); 56 | background-image:-moz-linear-gradient(top, #373a3d, #313437); 57 | background-image:linear-gradient(top, #373a3d, #313437); 58 | 59 | width:250px; 60 | padding:30px; 61 | border-radius:3px; 62 | 63 | margin:200px auto 100px; 64 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); 65 | } 66 | 67 | #drop{ 68 | background-color: #2E3134; 69 | padding: 40px 50px; 70 | margin-bottom: 30px; 71 | border: 20px solid rgba(0, 0, 0, 0); 72 | border-radius: 3px; 73 | border-image: url('../img/border-image.png') 25 repeat; 74 | text-align: center; 75 | text-transform: uppercase; 76 | 77 | font-size:16px; 78 | font-weight:bold; 79 | color:#7f858a; 80 | } 81 | 82 | #drop a{ 83 | background-color:#007a96; 84 | padding:12px 26px; 85 | color:#fff; 86 | font-size:14px; 87 | border-radius:2px; 88 | cursor:pointer; 89 | display:inline-block; 90 | margin-top:12px; 91 | line-height:1; 92 | } 93 | 94 | #drop a:hover{ 95 | background-color:#0986a3; 96 | } 97 | 98 | #drop input{ 99 | display:none; 100 | } 101 | 102 | #upload ul{ 103 | list-style:none; 104 | margin:0 -30px; 105 | border-top:1px solid #2b2e31; 106 | border-bottom:1px solid #3d4043; 107 | } 108 | 109 | #upload ul li{ 110 | 111 | background-color:#333639; 112 | 113 | background-image:-webkit-linear-gradient(top, #333639, #303335); 114 | background-image:-moz-linear-gradient(top, #333639, #303335); 115 | background-image:linear-gradient(top, #333639, #303335); 116 | 117 | border-top:1px solid #3d4043; 118 | border-bottom:1px solid #2b2e31; 119 | padding:15px; 120 | height: 52px; 121 | 122 | position: relative; 123 | } 124 | 125 | #upload ul li input{ 126 | display: none; 127 | } 128 | 129 | #upload ul li p{ 130 | width: 144px; 131 | overflow: hidden; 132 | white-space: nowrap; 133 | color: #EEE; 134 | font-size: 16px; 135 | font-weight: bold; 136 | position: absolute; 137 | top: 20px; 138 | left: 100px; 139 | } 140 | 141 | #upload ul li i{ 142 | font-weight: normal; 143 | font-style:normal; 144 | color:#7f7f7f; 145 | display:block; 146 | } 147 | 148 | #upload ul li canvas{ 149 | top: 15px; 150 | left: 32px; 151 | position: absolute; 152 | } 153 | 154 | #upload ul li span{ 155 | width: 15px; 156 | height: 12px; 157 | background: url('../img/icons.png') no-repeat; 158 | position: absolute; 159 | top: 34px; 160 | right: 33px; 161 | cursor:pointer; 162 | } 163 | 164 | #upload ul li.working span{ 165 | height: 16px; 166 | background-position: 0 -12px; 167 | } 168 | 169 | #upload ul li.error p{ 170 | color:red; 171 | } 172 | 173 | 174 | /*---------------------------- 175 | The Demo Footer 176 | -----------------------------*/ 177 | 178 | 179 | footer{ 180 | background-color: #080808; 181 | bottom: 0; 182 | box-shadow: 0 -1px 2px rgba(0,0,0,0.4); 183 | height: 40px; 184 | left: 0; 185 | position: fixed; 186 | width: 100%; 187 | z-index: 100000; 188 | } 189 | 190 | footer h2{ 191 | font-size: 14px; 192 | font-weight: normal; 193 | position: absolute; 194 | top:0; 195 | left: 50%; 196 | bottom:0; 197 | margin-left: -420px; 198 | padding:13px 20px 0; 199 | border:1px solid #000; 200 | border-width:0 1px; 201 | background-color:rgba(0,0,0,0.6); 202 | box-shadow:0 0 5px #000 inset; 203 | line-height: 1; 204 | margin-top: 0; 205 | } 206 | 207 | footer h2 a{ 208 | color: #EEEEEE !important; 209 | text-decoration:none !important; 210 | } 211 | 212 | footer h2 i{ 213 | font-style:normal; 214 | color:#888; 215 | } 216 | 217 | #tzine-download{ 218 | opacity:0.9; 219 | background-color:#257691; 220 | font-size:11px; 221 | text-align:center; 222 | text-transform:uppercase; 223 | width:150px; 224 | height:28px; 225 | line-height:28px; 226 | text-decoration:none !important; 227 | 228 | display: inline-block; 229 | border-radius: 2px; 230 | color: #fff !Important; 231 | font-weight: bold; 232 | box-shadow: 0 -1px 2px #1e5e74 inset; 233 | 234 | border-top:1px solid #26849c; 235 | 236 | text-shadow:1px 1px 1px #1e6176; 237 | margin-top:6px; 238 | } 239 | 240 | #tzine-download:hover{ 241 | opacity:1; 242 | } 243 | 244 | #tzine-actions{ 245 | position:absolute; 246 | top:0; 247 | width:500px; 248 | right:50%; 249 | margin-right:-420px; 250 | text-align:right; 251 | } 252 | 253 | #tzine-actions iframe{ 254 | display: inline-block; 255 | height: 21px; 256 | width: 95px; 257 | position: relative; 258 | float: left; 259 | margin-top: 11px; 260 | } 261 | -------------------------------------------------------------------------------- /uploads/script/assets/img/border-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/uploads/script/assets/img/border-image.png -------------------------------------------------------------------------------- /uploads/script/assets/img/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/izuolan/dockerfiles/5fbb36af329dcc3a4faf17fb39b9579a5f3ed600/uploads/script/assets/img/icons.png -------------------------------------------------------------------------------- /uploads/script/assets/js/jquery.iframe-transport.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Iframe Transport Plugin 1.6.1 3 | * https://github.com/blueimp/jQuery-File-Upload 4 | * 5 | * Copyright 2011, Sebastian Tschan 6 | * https://blueimp.net 7 | * 8 | * Licensed under the MIT license: 9 | * http://www.opensource.org/licenses/MIT 10 | */ 11 | 12 | /*jslint unparam: true, nomen: true */ 13 | /*global define, window, document */ 14 | 15 | (function (factory) { 16 | 'use strict'; 17 | if (typeof define === 'function' && define.amd) { 18 | // Register as an anonymous AMD module: 19 | define(['jquery'], factory); 20 | } else { 21 | // Browser globals: 22 | factory(window.jQuery); 23 | } 24 | }(function ($) { 25 | 'use strict'; 26 | 27 | // Helper variable to create unique names for the transport iframes: 28 | var counter = 0; 29 | 30 | // The iframe transport accepts three additional options: 31 | // options.fileInput: a jQuery collection of file input fields 32 | // options.paramName: the parameter name for the file form data, 33 | // overrides the name property of the file input field(s), 34 | // can be a string or an array of strings. 35 | // options.formData: an array of objects with name and value properties, 36 | // equivalent to the return data of .serializeArray(), e.g.: 37 | // [{name: 'a', value: 1}, {name: 'b', value: 2}] 38 | $.ajaxTransport('iframe', function (options) { 39 | if (options.async) { 40 | var form, 41 | iframe, 42 | addParamChar; 43 | return { 44 | send: function (_, completeCallback) { 45 | form = $('
'); 46 | form.attr('accept-charset', options.formAcceptCharset); 47 | addParamChar = /\?/.test(options.url) ? '&' : '?'; 48 | // XDomainRequest only supports GET and POST: 49 | if (options.type === 'DELETE') { 50 | options.url = options.url + addParamChar + '_method=DELETE'; 51 | options.type = 'POST'; 52 | } else if (options.type === 'PUT') { 53 | options.url = options.url + addParamChar + '_method=PUT'; 54 | options.type = 'POST'; 55 | } else if (options.type === 'PATCH') { 56 | options.url = options.url + addParamChar + '_method=PATCH'; 57 | options.type = 'POST'; 58 | } 59 | // javascript:false as initial iframe src 60 | // prevents warning popups on HTTPS in IE6. 61 | // IE versions below IE8 cannot set the name property of 62 | // elements that have already been added to the DOM, 63 | // so we set the name along with the iframe HTML markup: 64 | iframe = $( 65 | '' 67 | ).bind('load', function () { 68 | var fileInputClones, 69 | paramNames = $.isArray(options.paramName) ? 70 | options.paramName : [options.paramName]; 71 | iframe 72 | .unbind('load') 73 | .bind('load', function () { 74 | var response; 75 | // Wrap in a try/catch block to catch exceptions thrown 76 | // when trying to access cross-domain iframe contents: 77 | try { 78 | response = iframe.contents(); 79 | // Google Chrome and Firefox do not throw an 80 | // exception when calling iframe.contents() on 81 | // cross-domain requests, so we unify the response: 82 | if (!response.length || !response[0].firstChild) { 83 | throw new Error(); 84 | } 85 | } catch (e) { 86 | response = undefined; 87 | } 88 | // The complete callback returns the 89 | // iframe content document as response object: 90 | completeCallback( 91 | 200, 92 | 'success', 93 | {'iframe': response} 94 | ); 95 | // Fix for IE endless progress bar activity bug 96 | // (happens on form submits to iframe targets): 97 | $('') 98 | .appendTo(form); 99 | form.remove(); 100 | }); 101 | form 102 | .prop('target', iframe.prop('name')) 103 | .prop('action', options.url) 104 | .prop('method', options.type); 105 | if (options.formData) { 106 | $.each(options.formData, function (index, field) { 107 | $('') 108 | .prop('name', field.name) 109 | .val(field.value) 110 | .appendTo(form); 111 | }); 112 | } 113 | if (options.fileInput && options.fileInput.length && 114 | options.type === 'POST') { 115 | fileInputClones = options.fileInput.clone(); 116 | // Insert a clone for each file input field: 117 | options.fileInput.after(function (index) { 118 | return fileInputClones[index]; 119 | }); 120 | if (options.paramName) { 121 | options.fileInput.each(function (index) { 122 | $(this).prop( 123 | 'name', 124 | paramNames[index] || options.paramName 125 | ); 126 | }); 127 | } 128 | // Appending the file input fields to the hidden form 129 | // removes them from their original location: 130 | form 131 | .append(options.fileInput) 132 | .prop('enctype', 'multipart/form-data') 133 | // enctype must be set as encoding for IE: 134 | .prop('encoding', 'multipart/form-data'); 135 | } 136 | form.submit(); 137 | // Insert the file input fields at their original location 138 | // by replacing the clones with the originals: 139 | if (fileInputClones && fileInputClones.length) { 140 | options.fileInput.each(function (index, input) { 141 | var clone = $(fileInputClones[index]); 142 | $(input).prop('name', clone.prop('name')); 143 | clone.replaceWith(input); 144 | }); 145 | } 146 | }); 147 | form.append(iframe).appendTo(document.body); 148 | }, 149 | abort: function () { 150 | if (iframe) { 151 | // javascript:false as iframe src aborts the request 152 | // and prevents warning popups on HTTPS in IE6. 153 | // concat is used to avoid the "Script URL" JSLint error: 154 | iframe 155 | .unbind('load') 156 | .prop('src', 'javascript'.concat(':false;')); 157 | } 158 | if (form) { 159 | form.remove(); 160 | } 161 | } 162 | }; 163 | } 164 | }); 165 | 166 | // The iframe transport returns the iframe content document as response. 167 | // The following adds converters from iframe to text, json, html, and script: 168 | $.ajaxSetup({ 169 | converters: { 170 | 'iframe text': function (iframe) { 171 | return iframe && $(iframe[0].body).text(); 172 | }, 173 | 'iframe json': function (iframe) { 174 | return iframe && $.parseJSON($(iframe[0].body).text()); 175 | }, 176 | 'iframe html': function (iframe) { 177 | return iframe && $(iframe[0].body).html(); 178 | }, 179 | 'iframe script': function (iframe) { 180 | return iframe && $.globalEval($(iframe[0].body).text()); 181 | } 182 | } 183 | }); 184 | 185 | })); 186 | -------------------------------------------------------------------------------- /uploads/script/assets/js/script.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | var ul = $('#upload ul'); 4 | 5 | $('#drop a').click(function(){ 6 | // Simulate a click on the file input button 7 | // to show the file browser dialog 8 | $(this).parent().find('input').click(); 9 | }); 10 | 11 | // Initialize the jQuery File Upload plugin 12 | $('#upload').fileupload({ 13 | 14 | // This element will accept file drag/drop uploading 15 | dropZone: $('#drop'), 16 | 17 | // This function is called when a file is added to the queue; 18 | // either via the browse button, or via drag/drop: 19 | add: function (e, data) { 20 | 21 | var tpl = $('
  • '); 23 | 24 | // Append the file name and file size 25 | tpl.find('p').text(data.files[0].name) 26 | .append('' + formatFileSize(data.files[0].size) + ''); 27 | 28 | // Add the HTML to the UL element 29 | data.context = tpl.appendTo(ul); 30 | 31 | // Initialize the knob plugin 32 | tpl.find('input').knob(); 33 | 34 | // Listen for clicks on the cancel icon 35 | tpl.find('span').click(function(){ 36 | 37 | if(tpl.hasClass('working')){ 38 | jqXHR.abort(); 39 | } 40 | 41 | tpl.fadeOut(function(){ 42 | tpl.remove(); 43 | }); 44 | 45 | }); 46 | 47 | // Automatically upload the file once it is added to the queue 48 | var jqXHR = data.submit(); 49 | }, 50 | 51 | progress: function(e, data){ 52 | 53 | // Calculate the completion percentage of the upload 54 | var progress = parseInt(data.loaded / data.total * 100, 10); 55 | 56 | // Update the hidden input field and trigger a change 57 | // so that the jQuery knob plugin knows to update the dial 58 | data.context.find('input').val(progress).change(); 59 | 60 | if(progress == 100){ 61 | data.context.removeClass('working'); 62 | } 63 | }, 64 | 65 | fail:function(e, data){ 66 | // Something has gone wrong! 67 | data.context.addClass('error'); 68 | } 69 | 70 | }); 71 | 72 | 73 | // Prevent the default action when a file is dropped on the window 74 | $(document).on('drop dragover', function (e) { 75 | e.preventDefault(); 76 | }); 77 | 78 | // Helper function that formats the file sizes 79 | function formatFileSize(bytes) { 80 | if (typeof bytes !== 'number') { 81 | return ''; 82 | } 83 | 84 | if (bytes >= 1000000000) { 85 | return (bytes / 1000000000).toFixed(2) + ' GB'; 86 | } 87 | 88 | if (bytes >= 1000000) { 89 | return (bytes / 1000000).toFixed(2) + ' MB'; 90 | } 91 | 92 | return (bytes / 1000).toFixed(2) + ' KB'; 93 | } 94 | 95 | }); -------------------------------------------------------------------------------- /uploads/script/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 左蓝 - 上传 7 | 8 | 9 | 10 | 11 |
    12 | 18 |
      19 | 20 |
    21 |
    22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /uploads/script/upload.php: -------------------------------------------------------------------------------- 1 | 3 | ENV HOME=/home/user \ 4 | TERM=xterm-256color \ 5 | DISABLE="" 6 | 7 | RUN mkdir -p /home/user/workspace && \ 8 | apk add --update --no-cache vim 9 | RUN apk add --update curl && \ 10 | mkdir -p ~/.vim/bundle ~/.vim/autoload ~/.vim_runtime/temp_dirs && \ 11 | curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim && \ 12 | echo "execute pathogen#infect()" >> /etc/vim/vimrc && \ 13 | echo "syntax on" >> /etc/vim/vimrc && \ 14 | echo "filetype plugin indent on" >> /etc/vim/vimrc 15 | # apk del curl && rm -rf /var/cache/* /var/log/* /var/tmp/* 16 | 17 | # 插件依赖 18 | RUN apk --update add curl ctags git python bash ncurses-terminfo && \ 19 | # 安装 YouCompleteMe 20 | apk add --virtual build-deps go llvm perl cmake python-dev build-base && \ 21 | git clone --depth 1 https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe/ && \ 22 | cd ~/.vim/bundle/YouCompleteMe && \ 23 | git submodule update --init --recursive && \ 24 | ~/.vim/bundle/YouCompleteMe/install.py --gocode-completer && \ 25 | # 安装 procvim.vim 26 | git clone --depth 1 https://github.com/Shougo/vimproc.vim.git ~/.vim/bundle/vimproc.vim && \ 27 | cd ~/.vim/bundle/vimproc.vim && \ 28 | make && \ 29 | # 清理 30 | rm -rf ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp /usr/lib/go \ 31 | ~/.vim/bundle/YouCompleteMe/third_party/ycmd/clang_includes && \ 32 | apk del build-deps && \ 33 | apk add libxt libx11 libstdc++ 34 | 35 | RUN cd ~/.vim/bundle/ && \ 36 | git clone --depth 1 https://github.com/pangloss/vim-javascript.git && \ 37 | git clone --depth 1 https://github.com/scrooloose/nerdcommenter.git && \ 38 | git clone --depth 1 https://github.com/godlygeek/tabular.git && \ 39 | git clone --depth 1 https://github.com/Raimondi/delimitMate.git && \ 40 | git clone --depth 1 https://github.com/nathanaelkane/vim-indent-guides.git && \ 41 | git clone --depth 1 https://github.com/groenewege/vim-less.git && \ 42 | git clone --depth 1 https://github.com/othree/html5.vim.git && \ 43 | git clone --depth 1 https://github.com/elzr/vim-json.git && \ 44 | git clone --depth 1 https://github.com/bling/vim-airline.git && \ 45 | git clone --depth 1 https://github.com/easymotion/vim-easymotion.git && \ 46 | git clone --depth 1 https://github.com/mbbill/undotree.git && \ 47 | git clone --depth 1 https://github.com/majutsushi/tagbar.git && \ 48 | git clone --depth 1 https://github.com/vim-scripts/EasyGrep.git && \ 49 | git clone --depth 1 https://github.com/jlanzarotta/bufexplorer.git && \ 50 | git clone --depth 1 https://github.com/kien/ctrlp.vim.git && \ 51 | git clone --depth 1 https://github.com/scrooloose/nerdtree.git && \ 52 | git clone --depth 1 https://github.com/jistr/vim-nerdtree-tabs.git && \ 53 | git clone --depth 1 https://github.com/scrooloose/syntastic.git && \ 54 | git clone --depth 1 https://github.com/tomtom/tlib_vim.git && \ 55 | git clone --depth 1 https://github.com/marcweber/vim-addon-mw-utils.git && \ 56 | git clone --depth 1 https://github.com/altercation/vim-colors-solarized.git && \ 57 | git clone --depth 1 https://github.com/vim-scripts/taglist.vim.git && \ 58 | git clone --depth 1 https://github.com/terryma/vim-expand-region.git && \ 59 | git clone --depth 1 https://github.com/tpope/vim-fugitive.git && \ 60 | git clone --depth 1 https://github.com/airblade/vim-gitgutter.git && \ 61 | git clone --depth 1 https://github.com/fatih/vim-go.git && \ 62 | git clone --depth 1 https://github.com/plasticboy/vim-markdown.git && \ 63 | git clone --depth 1 https://github.com/michaeljsmith/vim-indent-object.git && \ 64 | git clone --depth 1 https://github.com/terryma/vim-multiple-cursors.git && \ 65 | git clone --depth 1 https://github.com/tpope/vim-repeat.git && \ 66 | git clone --depth 1 https://github.com/tpope/vim-surround.git && \ 67 | git clone --depth 1 https://github.com/vim-scripts/mru.vim.git && \ 68 | git clone --depth 1 https://github.com/vim-scripts/YankRing.vim.git && \ 69 | git clone --depth 1 https://github.com/tpope/vim-haml.git && \ 70 | git clone --depth 1 https://github.com/SirVer/ultisnips.git && \ 71 | git clone --depth 1 https://github.com/honza/vim-snippets.git && \ 72 | git clone --depth 1 https://github.com/derekwyatt/vim-scala.git && \ 73 | git clone --depth 1 https://github.com/leafgarland/typescript-vim.git && \ 74 | git clone --depth 1 https://github.com/christoomey/vim-tmux-navigator.git && \ 75 | git clone --depth 1 https://github.com/Quramy/tsuquyomi.git && \ 76 | git clone --depth 1 https://github.com/ekalinin/Dockerfile.vim.git && \ 77 | # 清理 78 | vim -E -c 'execute pathogen#helptags()' -c q ; return 0 79 | 80 | ENTRYPOINT ["vim"] 81 | --------------------------------------------------------------------------------