aboutsummaryrefslogtreecommitdiffstats
path: root/tools/docker/old-env/Dockerfile
blob: 5607f69676ab3213a3a66cae227bb451697ec585 (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
60
# 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.

# See /tools/docker/README.md for details.

FROM ubuntu:20.04

LABEL homepage="https://github.com/google/syzkaller"

RUN dpkg --add-architecture i386 && apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends sudo
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends make
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends nano
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends git
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends curl
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends ca-certificates
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends gnupg
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends apt-transport-https
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends software-properties-common
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends g++
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends g++-arm-linux-gnueabi
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends g++-aarch64-linux-gnu
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends g++-powerpc64le-linux-gnu
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends g++-mips64el-linux-gnuabi64
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends g++-s390x-linux-gnu
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends linux-libc-dev:i386
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends lib32gcc-9-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends lib32stdc++-9-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get -y autoremove
RUN DEBIAN_FRONTEND=noninteractive apt-get clean autoclean
RUN DEBIAN_FRONTEND=noninteractive rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*

# Since go 1.21 the toolchain required by go.mod is automatically downloaded.
# There is no need to version up golang here after go.mod changes.
RUN curl https://dl.google.com/go/go1.22.7.linux-amd64.tar.gz | tar -C /usr/local -xz
ENV PATH /usr/local/go/bin:/gopath/bin:$PATH
ENV GOPATH /gopath

# Install clang-12 from llvm.org.
# The distro-provided clang is too old for Go fuzzing.
RUN curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-12 main"
RUN apt-get update
RUN apt-get install -y -q --no-install-recommends clang-12
RUN ln -s /usr/bin/clang-12 /usr/bin/clang

# Pre-create dirs for syz-env.
# 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-old-env⌛ '" > /syzkaller/.bashrc
ENV SYZ_OLD_ENV yes

ENTRYPOINT ["bash"]