Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM golang:latest | ||
|
||
MAINTAINER etix@l0cal.com | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|