-
Notifications
You must be signed in to change notification settings - Fork 178
/
Dockerfile-ubuntu-22.04
41 lines (29 loc) · 1.35 KB
/
Dockerfile-ubuntu-22.04
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
# NOTE: We try to support Ubuntu 22.04 environment as it is the latest Ubuntu
# LTS release.
# Download base image ubuntu 22.04
FROM ubuntu:22.04
# LABEL about the custom image
LABEL version="0.1"
LABEL description="Docker Image for Building/Testing XLS on Ubuntu 22.04 x86-64"
# Update package info
RUN apt-get update -y
# Install bazelisk from latest release
RUN apt-get install -y curl python3
RUN curl -O -L $(curl -L \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/bazelbuild/bazelisk/releases | \
python3 -c 'import json; import sys; print(filter(lambda url: "linux-amd64" in url, (a["browser_download_url"] for a in json.load(sys.stdin)[0]["assets"])).__next__())')
RUN chmod +x bazelisk-linux-amd64 && mv bazelisk-linux-amd64 /usr/bin/bazel
# Install dependencies
RUN apt-get -y install python3-distutils python3-dev python-is-python3 libtinfo5 build-essential libxml2-dev liblapack-dev libblas-dev gfortran
# Install development tools
RUN apt-get install -y git vim
RUN useradd -m xls-developer
USER xls-developer
# Map the project contents in.
ADD --chown=xls-developer . /home/xls-developer/xls/
WORKDIR /home/xls-developer/xls/
# Test everything (opt), exclude xlscc for now due to increased build time when
# we add Clang.
RUN bazel test -c opt -- //xls/... -//xls/contrib/xlscc/...