-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathDockerfile
143 lines (142 loc) · 4.64 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2025 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
ARG UPX_OPTIONS=-9
# skipcq: DOK-DL3026,DOK-DL3007
FROM mcr.microsoft.com/devcontainers/base:ubuntu24.04
LABEL maintainer="vdaas.org vald team <[email protected]>"
# skipcq: DOK-DL3002
USER root:root
ARG TARGETARCH
ARG TARGETOS
ARG GO_VERSION
ARG RUST_VERSION
ENV APP_NAME=dev-container
ENV CC=gcc
ENV CXX=g++
ENV DEBIAN_FRONTEND=noninteractive
ENV GO111MODULE=on
ENV GOPATH=/go
ENV GOROOT=/opt/go
ENV HOME=/root
ENV INITRD=No
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV ORG=vdaas
ENV PKG=dev
ENV REPO=vald
ENV RUST_HOME=/usr/local/lib/rust
ENV TZ=Etc/UTC
ENV USER=root
ENV CARGO_HOME=${RUST_HOME}/cargo
ENV RUSTUP_HOME=${RUST_HOME}/rustup
ENV PATH=${CARGO_HOME}/bin:${GOPATH}/bin:${GOROOT}/bin:${RUSTUP_HOME}/bin:/usr/local/bin:${PATH}
WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
#skipcq: DOK-W1001, DOK-SC2046, DOK-SC2086, DOK-DL3008
RUN --mount=type=bind,target=.,rw \
--mount=type=tmpfs,target=/tmp \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=${APP_NAME} \
--mount=type=cache,target=/var/cache/apt,sharing=locked,id=${APP_NAME} \
--mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \
--mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \
--mount=type=tmpfs,target="${GOPATH}/src" \
set -ex \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \
&& echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/no-install-recommends \
&& apt-get clean \
&& apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends --fix-missing \
build-essential \
ca-certificates \
curl \
gnupg \
tzdata \
locales \
git \
cmake \
g++ \
gcc \
libssl-dev \
unzip \
liblapack-dev \
libomp-dev \
libopenblas-dev \
gfortran \
pkg-config \
file \
gawk \
gnupg2 \
graphviz \
jq \
libaec-dev \
sed \
zip \
&& ldconfig \
&& echo "${LANG} UTF-8" > /etc/locale.gen \
&& ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
&& locale-gen ${LANGUAGE} \
&& update-locale LANG=${LANGUAGE} \
&& dpkg-reconfigure -f noninteractive tzdata \
&& apt-get clean \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& make GOPATH="${GOPATH}" GOROOT="${GOROOT}" GO_VERSION="${GO_VERSION}" go/install \
&& make GOPATH="${GOPATH}" GOROOT="${GOROOT}" GO_VERSION="${GO_VERSION}" go/download \
&& make RUST_VERSION="${RUST_VERSION}" rust/install \
&& curl -fsSL https://deb.nodesource.com/setup_current.x | bash - \
&& apt-get clean \
&& apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends --fix-missing nodejs \
&& npm install -g npm@latest \
&& apt-get clean \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& make delve/install \
&& make gomodifytags/install \
&& make gopls/install \
&& make gotests/install \
&& make impl/install \
&& make staticcheck/install \
&& make GOARCH=${TARGETARCH} GOOS=${TARGETOS} deps GO_CLEAN_DEPS=false \
&& make GOARCH=${TARGETARCH} GOOS=${TARGETOS} golangci-lint/install \
&& make GOARCH=${TARGETARCH} GOOS=${TARGETOS} gotestfmt/install \
&& make cmake/install \
&& make buf/install \
&& make hdf5/install \
&& make helm-docs/install \
&& make helm/install \
&& make k3d/install \
&& make k9s/install \
&& make kind/install \
&& make kubectl/install \
&& make kubelinter/install \
&& make minikube/install \
&& make reviewdog/install \
&& make stern/install \
&& make telepresence/install \
&& make tparse/install \
&& make yq/install \
&& make ngt/install \
&& make faiss/install \
&& rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/*
# skipcq: DOK-DL3002
USER root:root