-
Notifications
You must be signed in to change notification settings - Fork 44
/
Dockerfile_developer
35 lines (27 loc) · 1.7 KB
/
Dockerfile_developer
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
FROM pubrepo.guance.com/base/ubuntu:20.04 AS base
ARG TARGETARCH
RUN export DEBIAN_FRONTEND=noninteractive \
&& sed -i 's/\(archive\|security\|ports\).ubuntu.com/mirrors.cloud.tencent.com/' /etc/apt/sources.list \
&& apt-get update && apt-get install -y git make curl tree tzdata zip unzip \
&& apt-get install -y clang llvm \
&& apt-get install -y gcc \
&& if [ "${TARGETARCH}" = "amd64" ]; then apt-get install -y gcc-multilib ; fi
ENV DK_BUILD_GO_VERSION=1.19.12
RUN curl -Lo go${DK_BUILD_GO_VERSION}.linux-${TARGETARCH}.tar.gz https://go.dev/dl/go${DK_BUILD_GO_VERSION}.linux-${TARGETARCH}.tar.gz \
&& rm -rf /usr/local/go \
&& tar -C /usr/local/ -xzf go${DK_BUILD_GO_VERSION}.linux-${TARGETARCH}.tar.gz \
&& rm -rf /usr/local/go${DK_BUILD_GO_VERSION} \
&& mv /usr/local/go /usr/local/go${DK_BUILD_GO_VERSION} \
&& rm go${DK_BUILD_GO_VERSION}.linux-${TARGETARCH}.tar.gz
ENV PATH=$PATH:/usr/local/go${DK_BUILD_GO_VERSION}/bin GOROOT=/usr/local/go${DK_BUILD_GO_VERSION}
RUN curl -Lo golangci-lint-1.46.2-linux-${TARGETARCH}.deb \
https://github.com/golangci/golangci-lint/releases/download/v1.46.2/golangci-lint-1.46.2-linux-${TARGETARCH}.deb \
&& dpkg -i golangci-lint-1.46.2-linux-${TARGETARCH}.deb \
&& rm -f golangci-lint-1.46.2-linux-${TARGETARCH}.deb \
&& go install golang.org/x/tools/cmd/goyacc@latest \
&& cp -r $HOME/go/bin/* /usr/local/bin
ENV KERNEL_SRC_VERSION=5.8.0-63-generic
ENV DK_BPF_KERNEL_SRC_PATH=/usr/src/linux-headers-${KERNEL_SRC_VERSION}
RUN mkdir -p /root/go/src/gitlab.jiagouyun.com/cloudcare-tools/ \
&& git config --global --add safe.directory /root/go/src/gitlab.jiagouyun.com/cloudcare-tools/datakit \
&& apt-get install -y linux-headers-${KERNEL_SRC_VERSION}