blob: f0eaa8b91b2bfc1fe26e07cec14ab142638cf80a (
plain)
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
|
# Copyright 2020 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
# The image provides dev environment suitable for syzkaller development/testing.
# It includes Go toolchain, C/C++ cross-compilers, go-fuzz and golangci-lint.
# The image is available as gcr.io/syzkaller/env.
# To download and run locally:
# docker pull gcr.io/syzkaller/env
# docker run -it gcr.io/syzkaller/env
# To build and push new version:
# docker build -t gcr.io/syzkaller/env tools/docker/env
# gcloud auth login && gcloud auth configure-docker
# docker push gcr.io/syzkaller/env
FROM debian:buster
LABEL homepage="https://github.com/google/syzkaller"
RUN dpkg --add-architecture i386 && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends \
sudo make nano git curl ca-certificates clang-format binutils g++ clang \
g++-arm-linux-gnueabi g++-aarch64-linux-gnu g++-powerpc64le-linux-gnu g++-mips64el-linux-gnuabi64 \
libc6-dev:i386 linux-libc-dev:i386 lib32gcc-8-dev lib32stdc++-8-dev \
# These are needed to build Linux kernel:
flex bison bc libelf-dev libssl-dev && \
apt-get -y autoremove && \
apt-get clean autoclean && \
rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
RUN curl https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz | tar -C /usr/local -xz
ENV PATH /usr/local/go/bin:/gopath/bin:$PATH
ENV GOPATH /gopath
# For golangci-lint we need only the binary.
RUN GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.26.0 && \
mv /gopath/bin/* /usr/local/bin/ && \
rm -rf /gopath
# For go-fuzz we also need sources (go-fuzz-dep).
RUN go get github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
# Pre-create dirs for syz-dock.
# This is necessary to make docker work with the current user,
# otherwise --volume will create these dirs under root and then
# the current user won't have access to them.
RUN mkdir -p /syzkaller/gopath/src/github.com/google/syzkaller && \
mkdir -p /syzkaller/.cache && \
chmod -R 0777 /syzkaller
# The default Docker prompt is too ugly and takes the whole line:
# I have no name!@0f3331d2fb54:~/gopath/src/github.com/google/syzkaller$
RUN echo "export PS1='syz-env🈴 '" > /syzkaller/.bashrc
ENV SYZ_ENV yes
ENTRYPOINT ["bash"]
|