-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (38 loc) · 1.08 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
41
42
43
44
45
# Shitposting custom golang docker image
# Pull from our tdlib debian base image
FROM ghcr.io/shitpostingio/tdlib:1.8
ENV GOLANG_VERSION 1.20.8
ENV goRelArch linux-amd64
ENV goRelSha256 cc97c28d9c252fbf28f91950d830201aa403836cbed702a05932e63f7f0c7bc4
# Utils
RUN apt-get update && apt-get install -y -qq \
wget \
openssl \
ca-certificates \
git \
sshpass \
# gcc for cgo
g++ \
gcc \
libc6-dev \
make \
pkg-config
# Install go
RUN set -eux; \
url="https://golang.org/dl/go${GOLANG_VERSION}.${goRelArch}.tar.gz"; \
wget -O go.tgz "$url"; \
echo "${goRelSha256} go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
export PATH="/usr/local/go/bin:$PATH";
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
# Clean up all the mess done by installing stuff
RUN apt-get clean \
&& apt-get autoclean \
&& echo -n > /var/lib/apt/extended_states \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /usr/share/man/?? \
&& rm -rf /usr/share/man/??_*