mirror of
https://github.com/h2non/imaginary.git
synced 2026-02-28 19:07:35 +01:00
41 lines
1.2 KiB
Docker
41 lines
1.2 KiB
Docker
# 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.5
|
|
|
|
# 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_SHA1 5817fa4b2252afdb02e11e8b9dc1d9173ef3bd5a
|
|
|
|
RUN curl -fsSL --insecure "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
|
|
&& echo "$GOLANG_DOWNLOAD_SHA1 golang.tar.gz" | sha1sum -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
|