diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-08-22 17:48:23 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-08-22 21:42:13 +0200 |
| commit | df5c8fa25ff3ed977df7bc12ac25b1e6b8ef2b21 (patch) | |
| tree | 89291e396fea9518de14487c98ca4d4245828e26 /tools | |
| parent | 49a5a1ab2f94353aa29edebdabc9eda5b168020b (diff) | |
tools/docker: add old-env
old-env is based on Ubuntu 16.04 and allows to test
executor build on older distributions.
Fixes #2055
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/docker/old-env/Dockerfile | 51 | ||||
| -rwxr-xr-x | tools/syz-env | 2 | ||||
| l--------- | tools/syz-old-env | 1 |
3 files changed, 54 insertions, 0 deletions
diff --git a/tools/docker/old-env/Dockerfile b/tools/docker/old-env/Dockerfile new file mode 100644 index 000000000..1d87853aa --- /dev/null +++ b/tools/docker/old-env/Dockerfile @@ -0,0 +1,51 @@ +# 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 and C/C++ cross-compilers. + +# The image is available as gcr.io/syzkaller/old-env. + +# To download and run locally: +# docker pull gcr.io/syzkaller/old-env +# docker run -it gcr.io/syzkaller/old-env + +# To build and push new version: +# docker build -t gcr.io/syzkaller/old-env tools/docker/old-env +# gcloud auth login && gcloud auth configure-docker +# docker push gcr.io/syzkaller/old-env + +FROM ubuntu:16.04 + +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 g++ \ + g++-arm-linux-gnueabi g++-aarch64-linux-gnu g++-powerpc64le-linux-gnu \ + g++-mips64el-linux-gnuabi64 g++-s390x-linux-gnu \ + linux-libc-dev:i386 lib32gcc-5-dev lib32stdc++-5-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 + +# 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"] diff --git a/tools/syz-env b/tools/syz-env index 07cc32186..11e24e424 100755 --- a/tools/syz-env +++ b/tools/syz-env @@ -50,6 +50,8 @@ SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)" IMAGE="env" if [ "$(basename -- "$0")" == "syz-big-env" ]; then IMAGE="big-env" +elif [ "$(basename -- "$0")" == "syz-old-env" ]; then + IMAGE="old-env" fi # Run everything as the host user, this is important for created/modified files. diff --git a/tools/syz-old-env b/tools/syz-old-env new file mode 120000 index 000000000..f0d710eb1 --- /dev/null +++ b/tools/syz-old-env @@ -0,0 +1 @@ +syz-env
\ No newline at end of file |
