Last active
January 13, 2020 07:56
-
-
Save calavera/324c12df120ccdc0bd05cc92aab7970f to your computer and use it in GitHub Desktop.
Dockerfile to build the Go version of Execsnoop and run it with JSON output format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
# Install BCC Tools | |
RUN set -ex; \ | |
echo "deb [trusted=yes] http://repo.iovisor.org/apt/bionic bionic-nightly main" > /etc/apt/sources.list.d/iovisor.list; \ | |
apt-get update -y; \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y auditd bcc-tools curl gcc git libelf1 libbcc-examples; | |
# Install Go | |
ENV GO_SHA 1dfe664fa3d8ad714bbd15a36627992effd150ddabd7523931f077b3926d736d | |
RUN set -ex; \ | |
curl -sSOL https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz; \ | |
echo "${GO_SHA} go1.11.2.linux-amd64.tar.gz" | sha256sum -c -; \ | |
tar -C /usr/local -xzf go1.11.2.linux-amd64.tar.gz; | |
ENV PATH $PATH:/usr/local/go/bin:/go/bin | |
ENV GOPATH /go | |
# Build Execsnoop | |
WORKDIR /go/src/execsnoop | |
COPY . . | |
RUN go get -d -v ./... | |
RUN go install -v ./... | |
CMD ["execsnoop", "-o", "json"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment