Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit bab636a

Browse files
committed
Use alpine as the base image
This cuts the Docker image size from 64.8MB to 12.6MB.
1 parent bbf6f60 commit bab636a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
FROM golang:1.10 as builder
2-
RUN apt-get -y update \
3-
&& apt-get -y install libnetfilter-queue-dev
1+
FROM golang:1.10-alpine as builder
2+
RUN apk add --no-cache gcc libnetfilter_queue-dev linux-headers musl-dev
43
WORKDIR /go/src/github.com/hownetworks/tracetrout
54
COPY . .
6-
RUN go build -o /tracetrout -ldflags="-s -w"
5+
RUN go build -o /tracetrout -ldflags='-s -w'
76

8-
FROM debian:stretch-slim
9-
RUN apt-get -y update \
10-
&& apt-get -y install iptables libnetfilter-queue1 \
11-
&& rm -rf /var/lib/apt/lists/*
12-
WORKDIR /go/src/app
7+
FROM alpine:3.7
8+
RUN apk add --no-cache iptables libnetfilter_queue
9+
WORKDIR /tracetrout
1310
COPY entrypoint.sh .
1411
COPY --from=builder /tracetrout .
1512
ENV PORT 8080

0 commit comments

Comments
 (0)