-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathDockerfile.depend
More file actions
33 lines (28 loc) · 1.23 KB
/
Dockerfile.depend
File metadata and controls
33 lines (28 loc) · 1.23 KB
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
#
# Docker image with golang, dependancies and linters
# use to build the code in a stable and cached environment
#
FROM ubuntu:24.04 AS dependencies
ENV GOVERSION=1.26.1
ENV GOLANGCILINT_VERSION=v2.11.4
ENV MARKDOWNLINT_VERSION=0.48.0
ENV UNATTENDED=y
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
apt-utils wget cmake curl git docker.io && \
curl -sSfL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get update -y -q && apt-get install -y -qq --no-install-recommends nodejs && \
npm install -g --no-progress markdownlint-cli@${MARKDOWNLINT_VERSION}
RUN wget -nv "https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz" -O "/tmp/go.tar.gz" && \
tar -C /usr/local --strip-components=1 -xzf "/tmp/go.tar.gz" && \
rm -f "/tmp/go.tar.gz" && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b $(go env GOPATH)/bin ${GOLANGCILINT_VERSION}
ENV PATH=$PATH:/root/go/bin/
# Get modules used by the source code
RUN mkdir -p /vpp-dataplane
RUN git config --global --add safe.directory /vpp-dataplane
COPY go.mod /vpp-dataplane
COPY go.sum /vpp-dataplane
WORKDIR /vpp-dataplane
RUN go mod download && rm -fr /vpp-dataplane