-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
34 lines (23 loc) · 846 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Build
FROM golang:1.9.2 as build
WORKDIR /go/src/github.com/razaj92/aptly-mirror
COPY Makefile .
RUN make setup
COPY . .
RUN make build
# Main
FROM alpine:latest
ENV APTLY_VERSION 1.2.0
ENV GNUPGHOME /var/lib/aptly/gpg
RUN apk --no-cache --progress add git curl bzip2 gnupg1 xz && \
mkdir -p /app/aptly && \
curl -L https://bintray.com/artifact/download/smira/aptly/aptly_${APTLY_VERSION}_linux_amd64.tar.gz | tar zx -C /app/aptly --strip-components=1 && \
ln -s /app/aptly/aptly /usr/bin/aptly && \
rm -rf /var/cache/apk/*
COPY --from=build /go/src/github.com/razaj92/aptly-mirror/aptly-mirror /usr/local/bin/
COPY files/entrypoint.sh /
RUN addgroup -S -g 501 aptly \
&& adduser -S -s /bin/bash -u 501 -G aptly -h /var/lib/aptly aptly > /dev/null 2>&1
USER 501:501
VOLUME /var/lib/aptly
ENTRYPOINT ["aptly-mirror"]