Skip to content

Commit 5b4e384

Browse files
authored
chore: Add dockerfile and docker-compose to build arm64 profiler locally. (#1717)
1 parent d7bb7f2 commit 5b4e384

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

src/Agent/NewRelic/Profiler/docker-compose.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2.1'
1+
version: '3.4'
22

33
services:
44

@@ -19,3 +19,12 @@ services:
1919
- .:/profiler
2020
- $CORECLR_NEWRELIC_HOME:/agent
2121
working_dir: /profiler/linux/
22+
build_arm64:
23+
platform: linux/arm64/v8
24+
build:
25+
context: linux/.
26+
dockerfile: Arm64Dockerfile
27+
command: bash -c "dos2unix ./build_profiler.sh && chmod 777 build_profiler.sh && ./build_profiler.sh"
28+
volumes:
29+
- .:/profiler
30+
working_dir: /profiler/linux
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This builds an Ubuntu image, clones the coreclr github repo and builds it.
2+
# It then sets up the environment for compiling the New Relic .NET profiler.
3+
4+
FROM ubuntu:18.04
5+
6+
RUN apt-get update -q -y
7+
RUN apt-get install -q -y \
8+
wget \
9+
curl \
10+
git \
11+
dos2unix \
12+
software-properties-common \
13+
make \
14+
binutils \
15+
libc++-dev \
16+
clang-3.9 \
17+
lldb-3.9 \
18+
build-essential
19+
20+
RUN echo "deb https://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main" | tee /etc/apt/sources.list.d/llvm.list
21+
RUN wget --no-cache --no-cookies -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
22+
23+
# The CoreCLR build notes say their repos should be pulled into a `git` directory.
24+
# Not sure how necessary that is.
25+
RUN mkdir /root/git
26+
WORKDIR /root/git
27+
28+
RUN git clone --branch release/3.1 https://github.com/dotnet/coreclr.git
29+
30+
RUN curl -sSL https://virtuoso-testing.s3.us-west-2.amazonaws.com/cmake-3.9.0-rc3-aarch64.tar.gz | tar -xzC ~
31+
RUN chmod 777 ~/cmake-3.9.0-rc3-aarch64/bin/cmake
32+
33+
RUN ln -s ~/cmake-3.9.0-rc3-aarch64/bin/cmake /usr/bin/cmake || true
34+
RUN rm /usr/bin/cc || true
35+
RUN ln -s /usr/bin/clang-3.9 /usr/bin/cc
36+
RUN rm /usr/bin/c++ || true
37+
RUN ln -s /usr/bin/clang++-3.9 /usr/bin/c++

0 commit comments

Comments
 (0)