forked from h2non/imaginary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (30 loc) · 1.18 KB
/
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
35
36
37
38
39
40
# Start from a Debian image with the latest version of Go installed
# and a workspace (GOPATH) configured at /go.
FROM marcbachmann/libvips
MAINTAINER tomas@aparicio.me
# Server port to listen
ENV PORT 9000
# Go version to use
ENV GOLANG_VERSION 1.6
# gcc for cgo
RUN apt-get update && apt-get install -y \
gcc curl git libc6-dev make ca-certificates \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 5470eac05d273c74ff8bac7bef5bad0b5abbd1c4052efbdbc8db45332e836b0b
RUN curl -fsSL --insecure "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
# Fetch the latest version of the package
RUN go get -u golang.org/x/net/context
RUN go get -u github.com/h2non/imaginary
# Run the outyet command by default when the container starts.
ENTRYPOINT ["/go/bin/imaginary"]
# Expose the server TCP port
EXPOSE 9000