Skip to content

Instantly share code, notes, and snippets.

@calavera
Last active January 13, 2020 07:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save calavera/324c12df120ccdc0bd05cc92aab7970f to your computer and use it in GitHub Desktop.
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
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