forked from parca-dev/parca-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
67 lines (53 loc) · 2.42 KB
/
Dockerfile.dev
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
FROM docker.io/golang:1.18.3-bullseye@sha256:d146bc2ee9b0691f4f787bd9a8bf12e3c01a4618ea982d11fe9401b86211e2a7 AS build
# TODO(kakkoyun): Modify Tilt and Dockerfile.dev (this file) to build binaries outside the container and update the name.
# renovate: datasource=github-releases depName=rust-lang/rustup
ARG RUSTUP_VERSION=1.24.3
# renovate: datasource=go depName=github.com/go-delve/delve
ARG DELVE_VERSION=v1.8.3
# For more information about the snapshots, see: https://snapshot.debian.org/
RUN printf '\
deb http://snapshot.debian.org/archive/debian/20220420T025302Z bullseye main\n\
deb http://snapshot.debian.org/archive/debian/20220420T025302Z bullseye-updates main\n\
deb http://snapshot.debian.org/archive/debian/20220420T025302Z bullseye-backports main\n\
deb http://snapshot.debian.org/archive/debian-security/20220420T025302Z bullseye-security main\n\
deb http://snapshot.debian.org/archive/debian/20220420T025302Z sid main\n\
' > /etc/apt/sources.list
# NOTICE: -o Acquire::Check-Valid-Until="false" added as a mitigation,
# see https://github.com/parca-dev/parca-agent/issues/10 for further details.
# hadolint ignore=DL3008
RUN apt-get -o Acquire::Check-Valid-Until="false" update -y && \
apt-get install --no-install-recommends -yq \
llvm-14-dev \
libclang-14-dev \
clang-14 \
make \
zlib1g-dev \
libelf-dev && \
ln -s /usr/bin/clang-14 /usr/bin/clang && \
ln -s /usr/bin/llc-14 /usr/bin/llc
WORKDIR /parca-agent
# Install Rust
COPY rust-toolchain.toml /parca-agent
# SHELL is not supported for OCI image format
# https://github.com/containers/buildah/blob/v1.26.1/config.go#L366-L377
# hadolint ignore=DL4006
RUN curl --proto '=https' --tlsv1.2 -sSf "https://raw.githubusercontent.com/rust-lang/rustup/${RUSTUP_VERSION}/rustup-init.sh" \
| sh -s -- --default-toolchain none -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup show
COPY go.mod go.sum /parca-agent/
RUN go mod download -modcacherw
COPY Makefile /parca-agent
COPY 3rdparty /parca-agent/3rdparty
COPY bpf /parca-agent/bpf
RUN make -C bpf setup
# hadolint ignore=DL3059
RUN make bpf
# hadolint ignore=DL3059
RUN go install "github.com/go-delve/delve/cmd/dlv@${DELVE_VERSION}"
COPY . /parca-agent
RUN make build
RUN cp ./dist/parca-agent /bin/parca-agent
RUN cp /go/bin/dlv /dlv
EXPOSE 7071
ENTRYPOINT ["/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "--continue", "--"]