gopkg.in/hugelgupf/u-root.v9@v9.0.0-20180831063832-3f6f1057f09b/.circleci/images/integration/Dockerfile (about) 1 # Copyright 2018 the u-root Authors. All rights reserved 2 # Use of this source code is governed by a BSD-style 3 # license that can be found in the LICENSE file. 4 5 # Build: 6 # 7 # sudo docker build . -t uroottest/x86-integration 8 # 9 # Run: 10 # 11 # sudo docker run --rm -it uroottest/x86-integration 12 # 13 # More instructions: 14 # 15 # https://circleci.com/docs/2.0/custom-images/ 16 17 FROM circleci/golang:1.10.3 18 19 # Install dependencies 20 RUN sudo apt-get update && \ 21 sudo apt-get install -y --no-install-recommends \ 22 `# Linux dependencies` \ 23 git \ 24 bc \ 25 bison \ 26 flex \ 27 gcc \ 28 make \ 29 `# QEMU dependencies` \ 30 libglib2.0-dev \ 31 libfdt-dev \ 32 libpixman-1-dev \ 33 zlib1g-dev && \ 34 sudo rm -rf /var/lib/apt/lists/* 35 36 # Create working directory 37 WORKDIR /home/circleci 38 COPY config_linux4.17_amd64.txt .config 39 40 # Build linux 41 RUN set -eux; \ 42 git clone --depth=1 --branch=v4.17 https://github.com/torvalds/linux; \ 43 mv .config linux/; \ 44 cd linux; \ 45 make -j$(($(nproc) * 2 + 1)); \ 46 cd ~; \ 47 cp linux/arch/x86_64/boot/bzImage bzImage; \ 48 rm -rf linux/ 49 50 # Build QEMU 51 RUN set -eux; \ 52 git clone --depth=1 --branch=v2.12.0 https://github.com/qemu/qemu; \ 53 cd qemu; \ 54 mkdir build; \ 55 cd build; \ 56 ../configure \ 57 --target-list=x86_64-softmmu \ 58 --disable-docs \ 59 --disable-sdl \ 60 --disable-kvm; \ 61 make -j$(($(nproc) * 2 + 1)); \ 62 cd ~; \ 63 cp -rL qemu/build/pc-bios/ ~/pc-bios; \ 64 cp qemu/build/x86_64-softmmu/qemu-system-x86_64 .; \ 65 rm -rf qemu/ 66 67 # Export paths to binaries. 68 ENV UROOT_KERNEL /home/circleci/bzImage 69 ENV UROOT_QEMU "/home/circleci/qemu-system-x86_64 -L /home/circleci/pc-bios"