forked from dfinity/ic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bazel: Provide minimal CI and developer docker image
- Loading branch information
Ali Piccioni
committed
Sep 27, 2022
1 parent
f6a3f5e
commit d0705a6
Showing
11 changed files
with
124 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
FROM ubuntu@sha256:a0a45bd8c6c4acd6967396366f01f2a68f73406327285edc5b7b07cb1cf073db | ||
|
||
ARG USER=ubuntu | ||
ARG UID=1000 | ||
|
||
ENV TZ=UTC | ||
|
||
RUN export DEBIAN_FRONTEND=noninteractive && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ | ||
apt -yq update && apt -yqq install \ | ||
curl build-essential git gnupg \ | ||
# GitLab CI \ | ||
sudo gosu \ | ||
# RUST \ | ||
gcc lld pkg-config libssl-dev libunwind-dev libsqlite3-dev zlib1g-dev libclang-10-dev \ | ||
# IC-OS \ | ||
python3 fakeroot android-sdk-ext4-utils cryptsetup-bin zstd lsb-release grub-efi-amd64-bin libsystemd-dev faketime dosfstools libselinux-dev mtools | ||
|
||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \ | ||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ | ||
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key" | apt-key add - && \ | ||
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list && \ | ||
apt -yq update && \ | ||
apt -yqq install --no-install-recommends docker-ce-cli podman buildah | ||
|
||
|
||
ARG bazelisk_sha=8b739ac23a189b70d51a98041e90ba16f6559d5f991d83bbc031c740f8796310 | ||
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.12.2/bazelisk-linux-amd64 -o /usr/bin/bazel && \ | ||
echo "$bazelisk_sha /usr/bin/bazel" | sha256sum --check && \ | ||
chmod 777 /usr/bin/bazel | ||
|
||
RUN useradd -ms /bin/bash -u ${UID} ${USER} && \ | ||
mkdir -p /home/${USER} && \ | ||
chown -R ${UID}.${UID} /home/${USER} | ||
|
||
# CI before script requires sudo | ||
RUN usermod -a -G sudo ${USER} && echo "${USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | ||
|
||
# Init for reaping zombies and performing signal forwarding (https://github.com/krallin/tini) | ||
ARG tini_version=0.19.0 | ||
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${tini_version}/tini -o /tini && \ | ||
curl -fsSL https://github.com/krallin/tini/releases/download/v${tini_version}/tini.asc -o /tini.asc && \ | ||
chmod +x /tini | ||
RUN gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 && \ | ||
gpg --batch --verify /tini.asc /tini && chmod +x /tini | ||
|
||
USER ${USER} | ||
# Pre-populate the Bazel installation. | ||
RUN USE_BAZEL_VERSION=5.3.0 bazel version | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
WORKDIR / | ||
USER 0 | ||
|
||
RUN mv /usr/bin/docker /usr/bin/docker-bin | ||
COPY containers.conf /etc/containers/containers.conf | ||
COPY docker.sh /usr/bin/docker | ||
|
||
RUN echo "USER=${USER}" > /entrypoint_user | ||
|
||
ENTRYPOINT ["/tini", "--", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
392b3d6501244d8e8fb8e8626894fce0418cc834d505f0571e142d4bbb8dc8c1 | ||
7249151494ab726f8e5c049c6d6aac39749f9cb8f277db296f1daf85b07fe7fd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters