Permalink
Please sign in to comment.
Browse files
Add a Dockerfile
First, start a redis container: $ docker run --name redis -d redis Build the mirrorbits container: $ docker build -t mirrorbits . Start the mirrorbits container and mount the repository from the host: $ docker run --name mirrorbits --link redis:redis -v /path/to/repo/on/host:/srv/repo -i -t mirrorbits Finally, to access the cli: $ docker exec -i -t mirrorbits /bin/bash You can now issue 'mirrorbits' cli commands within the container.
- Loading branch information...
Showing
with
50 additions
and 0 deletions.
- +17 −0 Dockerfile
- +23 −0 contrib/docker/mirrorbits.conf
- +10 −0 contrib/docker/prepare.sh
17
Dockerfile
| @@ -0,0 +1,17 @@ | ||
| +FROM golang:latest | ||
| + | ||
| +MAINTAINER [email protected] | ||
| + | ||
| +ADD . /go/src/github.com/etix/mirrorbits | ||
| + | ||
| +RUN apt-get update -y && apt-get install -y apt-utils | ||
| +RUN apt-get install -y pkg-config zlib1g-dev libgeoip-dev rsync | ||
| +RUN mkdir /var/log/mirrorbits && mkdir /srv/repo && touch /srv/repo/hello | ||
| +RUN /bin/bash /go/src/github.com/etix/mirrorbits/contrib/geoip/geoip-lite-update | ||
| +RUN cd /go/src/github.com/etix/mirrorbits && go get -d ./... | ||
| +RUN cd /go/src/github.com/etix/mirrorbits && make | ||
| +RUN ln -s /go/src/github.com/etix/mirrorbits/bin/mirrorbits /usr/bin/mirrorbits && ln -s /go/src/github.com/etix/mirrorbits/contrib/docker/mirrorbits.conf /etc/mirrorbits.conf | ||
| + | ||
| +ENTRYPOINT /bin/sh /go/src/github.com/etix/mirrorbits/contrib/docker/prepare.sh && /usr/bin/mirrorbits -config /etc/mirrorbits.conf -D | ||
| + | ||
| +EXPOSE 8080 |
| @@ -0,0 +1,23 @@ | ||
| +# vim: set ft=yaml: | ||
| + | ||
| +Repository: /srv/repo | ||
| +Templates: /go/src/github.com/etix/mirrorbits/templates/ | ||
| +GoogleMapsAPIKey: | ||
| +OutputMode: auto | ||
| +ListenAddress: :8080 | ||
| +Gzip: false | ||
| +LogDir: /var/log/mirrorbits | ||
| +TraceFileLocation: | ||
| +GeoipDatabasePath: /usr/share/GeoIP/ | ||
| +ConcurrentSync: 5 | ||
| +ScanInterval: 30 | ||
| +CheckInterval: 1 | ||
| +RepositoryScanInterval: 5 | ||
| +Hashes: | ||
| + SHA1: Off | ||
| + SHA256: On | ||
| + MD5: Off | ||
| +DisallowRedirects: false | ||
| +WeightDistributionRange: 1.5 | ||
| +DisableOnMissingFile: false | ||
| +MaxLinkHeaders: 10 |
| @@ -0,0 +1,10 @@ | ||
| +#!/bin/sh | ||
| + | ||
| +if [ -z "$REDIS_PORT_6379_TCP_ADDR" ] || [ -z "$REDIS_PORT_6379_TCP_PORT" ] | ||
| +then | ||
| + echo "Missing link to Redis: use --link redis:redis" | ||
| + exit 1 | ||
| +fi | ||
| + | ||
| +echo "RedisAddress: $REDIS_PORT_6379_TCP_ADDR:$REDIS_PORT_6379_TCP_PORT" >> /go/src/github.com/etix/mirrorbits/contrib/docker/mirrorbits.conf | ||
| + |
0 comments on commit
59ba21b