Skip to content

Commit ee07004

Browse files
committed
Release process for building tiny docker images
1 parent 32b3cc0 commit ee07004

File tree

6 files changed

+43
-12
lines changed

6 files changed

+43
-12
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.aptcache
2-
apt-proxy
2+
apt-proxy
3+
release/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.aptcache
22
apt-proxy
3+
last-cid

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
FROM ubuntu:14.10
22

33
RUN apt-get update
4-
RUN apt-get install -y golang git
4+
RUN apt-get install -y golang
55

6-
ENV GOPATH /app
7-
ADD . /app/src/github.com/lox/apt-proxy
6+
RUN mkdir -p /go
7+
ENV GOPATH /go
8+
ENV GOBIN /go/bin
9+
ADD . /go/src/github.com/lox/apt-proxy
810

9-
WORKDIR /app/src/github.com/lox/apt-proxy
10-
RUN go get
11-
12-
EXPOSE 8080
13-
CMD ["go", "run", "/app/src/github.com/lox/apt-proxy/apt-proxy.go"]
11+
EXPOSE 3142
12+
WORKDIR /go/src/github.com/lox/apt-proxy
13+
CMD ["go", "run", "/go/src/github.com/lox/apt-proxy/apt-proxy.go"]

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
# Apt Proxy
22

3-
A caching proxy specifically for apt package caching, also rewrites to the fastest local mirror.
3+
A caching proxy specifically for apt package caching, also rewrites to the fastest local mirror. Built as a tiny docker image for easy deployment.
44

55
Built because [apt-cacher-ng](https://www.unix-ag.uni-kl.de/~bloch/acng/) is unreliable.
66

77
## Running via Go
88

9-
```
9+
```bash
1010
go install github.com/lox/apt-proxy
1111
$GOBIN/apt-proxy
12-
```
12+
```
13+
14+
## Running in Docker for Development
15+
16+
```bash
17+
docker build --rm --tag=apt-proxy-dev .
18+
docker run -it --rm --publish=3142 apt-proxy-dev
19+
```
20+
21+
## Building in Docker for Release
22+
23+
```bash
24+
docker build --rm --tag=apt-proxy-dev .
25+
docker run -it --cidfile last-cid apt-proxy-dev ./build.sh
26+
docker cp $(cat last-cid):/apt-proxy release/
27+
docker build --tag=apt-proxy ./release
28+
rm last-cid
29+
```
30+
31+
## Running from Docker
32+
33+
```
34+
docker run -it --rm --publish=3142 lox24/apt-proxy
35+
```

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash -ex
2+
go build -o /apt-proxy .

release/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM progrium/busybox
2+
ADD apt-proxy /apt-proxy
3+
EXPOSE 3142
4+
CMD ["/apt-proxy"]

0 commit comments

Comments
 (0)