42 lines
909 B
Markdown
42 lines
909 B
Markdown
|
# 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
|
||
|
```
|
||
|
|
||
|
## Next step
|
||
|
|
||
|
Next step: [Create http service](02-create-service.md)
|