Skip to content

Commit 11402c9

Browse files
jordan-bonserJonathan Watson
authored andcommitted
feat(ci): add bob-build-env Dockerfile
this is used to contain all the dependencies required to run the build tests including bazel/bazelisk. Change-Id: I4c9c2b1e43209c24e511b732232ac0bce0a2417d Signed-off-by: Jordan Bonser <jordan.bonser@arm.com>
1 parent 14ff0ab commit 11402c9

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

ci/docker/bob-build-env/Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
ARG GO_VERSION=1.18
2+
FROM golang:${GO_VERSION}-bullseye
3+
4+
ARG BAZELISK_VERSION=1.24.0
5+
RUN CGO_ENABLED=0 GOOS=linux GOBIN=/usr/local/bin go install github.com/bazelbuild/bazelisk@v${BAZELISK_VERSION}
6+
7+
# Install packages
8+
# git required for blueprint
9+
# build-essential needed for io_bazel_rules_go
10+
RUN apt update \
11+
&& apt -y --no-install-recommends install \
12+
ca-certificates \
13+
build-essential \
14+
gcc-aarch64-linux-gnu \
15+
git \
16+
ninja-build \
17+
python3 \
18+
python3-dev \
19+
python3-pip \
20+
python-is-python3 \
21+
python3-ply \
22+
rsync \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
RUN printf '%s\n' 'export PATH=/home/ci/.local/bin:/go/bin:/usr/local/go/bin:$PATH' \
26+
> /etc/profile.d/bob-build-env-path.sh
27+
28+
29+
ARG USER_ID=1001
30+
RUN useradd --create-home --shell /bin/bash --uid $USER_ID ci
31+
USER ci
32+
WORKDIR /home/ci
33+
34+
ENV PATH=/home/ci/.local/bin:$PATH
35+
ENV BAZELISK_HOME=/home/ci/.cache/bazelisk
36+
37+
# Pre-download _latest_ bazel version to save time in CI
38+
RUN bash -lc 'go version' && \
39+
USE_BAZEL_VERSION=latest bazelisk --version && \
40+
USE_BAZEL_VERSION=8.0.0 bazelisk --version

ci/docker/bob-build-env/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# bob-build-env docker image
2+
3+
This docker image contains the required dependencies to run the build tests in ci, including
4+
the new bazel based build tests.
5+
6+
# Creating the docker image
7+
8+
```
9+
docker build -t bob-build-env ci/docker/bob-build-env/
10+
docker tag bob-build-env:latest gpuddk--docker.artifactory.arm.com/gpuddk/bob-build-env:latest
11+
```
12+
13+
# Pushing to Artifactory
14+
15+
```
16+
export EMAIL=<your_email>
17+
export ART_TOKEN=<artifactory_token>
18+
docker login -u$EMAIL -p$ART_TOKEN gpuddk--docker.artifactory.arm.com
19+
docker push gpuddk--docker.artifactory.arm.com/gpuddk/bob-build-env:latest
20+
```

0 commit comments

Comments
 (0)