Skip to content

Instantly share code, notes, and snippets.

@jeremymeng
Last active April 18, 2018 00:04
Show Gist options
  • Save jeremymeng/4f612d952a38ce389f88eb25ec61791d to your computer and use it in GitHub Desktop.
Save jeremymeng/4f612d952a38ce389f88eb25ec61791d to your computer and use it in GitHub Desktop.
aspnetcore with perfcollect
FROM microsoft/aspnetcore
# install various tools that are required by perfcollect
RUN apt-get update \
&& apt-get -y install zip unzip binutils htop \
linux-tools lttng-tools liblttng-ust-dev
RUN mkdir /tools \
&& curl -L http://aka.ms/perfcollect > /tools/perfcollect \
&& chmod +x /tools/perfcollect
# Possible mismatch between host kernel version and container linux-tools package version.
# However, perf is generic enough to work anyway.
RUN version="$(uname -r)" \
&& version="${version%%-*}" \
&& case "$version" in *.*.*) version="${version%.*}";; esac \
&& perfbin="$(ls /usr/bin/perf_*)" \
&& test -e /usr/bin/perf_$version && echo "/usr/bin/perf_$version existed" || ln -s $perfbin /usr/bin/perf_$version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment