Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
zetasql docker compilation
FROM ubuntu:latest
FROM ubuntu:latest
RUN apt-get -y update
RUN apt-get -y install wget pkg-config zip g++ zlib1g-dev unzip python3 git make bash-completion python apt-utils
RUN wget https://github.com/bazelbuild/bazel/releases/download/0.26.1/bazel_0.26.1-linux-x86_64.deb
RUN dpkg -i bazel_0.26.1-linux-x86_64.deb
RUN apt-get -y install openjdk-8-jdk-headless
RUN apt-get -y install python3-distutils
RUN apt-get install --fix-broken
## PROVIDED FROM COMMAND LINE
ARG uid
ARG gid
ARG user
ARG group
ENV HOME=/build
## users group is already present remove before adding
RUN groupdel users && groupadd -g ${gid} ${group} && useradd -M -d $HOME -g ${gid} -u ${uid} ${user}
USER ${user}
WORKDIR /build
CMD bazel build --symlink_prefix=/ zetasql/...
#CMD /bin/bash
#!/bin/sh
user=$(id -u -n)
group=$(id -g -n)
uid=$(id -u)
gid=$(id -g)
docker build -t zetasql-build --build-arg uid=$uid --build-arg gid=$gid --build-arg user=$user --build-arg group=$group docker/
## set this to 1 or 2 less than the cores...
docker run --cpus 10 --rm \
--mount type=bind,source=$(pwd),destination=/build \
-i -t \
zetasql-build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.