Skip to content

Instantly share code, notes, and snippets.

@nektro
Created March 19, 2021 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nektro/39c00c6cd7eecfa59f35bd102c685738 to your computer and use it in GitHub Desktop.
Save nektro/39c00c6cd7eecfa59f35bd102c685738 to your computer and use it in GitHub Desktop.
minimal requirements to build and install zig from scratch with docker
#!/usr/bin/env bash
set -e
set -x
git clone https://github.com/ziglang/zig
cd zig
mkdir build && cd build
cmake ..
make
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root
COPY . .
RUN apt update
RUN apt -y upgrade
RUN apt -y install apt-utils apt-transport-https ca-certificates
RUN apt -y install wget gpg
RUN echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-11 main" >> /etc/apt/sources.list
RUN echo "deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-11 main" >> /etc/apt/sources.list
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt update
RUN apt -y install git cmake make gcc g++
RUN apt -y install llvm-11 llvm-11-dev
RUN apt -y install clang-11 libclang-11-dev
RUN apt -y install lld-11 liblld-11-dev
RUN ./build_zig.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment