🐒 Add docker instructions

This commit is contained in:
cheshire 2023-11-01 11:36:44 +01:00
parent 41784b5755
commit 30ccad0559

38
01-prepare-docker.md Normal file
View file

@ -0,0 +1,38 @@
# Preparing Docker environment
We create a `Dockerfile`:
```Dockerfile
FROM ubuntu:22.04
RUN apt-get -y update
RUN apt-get -y install default-jre default-jdk python3-dev build-essential clang wget libpq-dev zip git
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -O /usr/bin/bazel
RUN chmod +x /usr/bin/bazel
RUN git clone "https://gerrit.hackerspace.pl/hscloud"
WORKDIR /hscloud
RUN groupadd appgroup && useradd -m -s /bin/bash -g appgroup appuser
RUN chown -R appuser:appgroup /hscloud
USER appuser
RUN bazel build //tools:install
RUN bazel run //tools:install
ENV PATH="$PATH:/hscloud/bazel-bin/tools:/hscloud/bazel-bin/cluster/tools"
```
Now we run
```bash
docker build -t hscloud:latest .
```
after build we can access terminal by:
```bash
docker run hscloud:latest -it
```