2024-02-20 23:13:43 +00:00
|
|
|
# Quilibrium Docker Instructions
|
|
|
|
|
|
|
|
## Build
|
|
|
|
|
2024-05-27 05:10:15 +00:00
|
|
|
The only requirements are `git` (to checkout the repository) and docker (to build the image).
|
2024-03-08 05:05:23 +00:00
|
|
|
Golang does not have to be installed, the docker image build process uses a build stage that provides the
|
|
|
|
correct Go environment and compiles the node down to one command.
|
|
|
|
|
2024-06-08 11:32:45 +00:00
|
|
|
In the repository root folder, where the [Dockerfile.source](Dockerfile.source) file is, build the docker image:
|
2024-02-20 23:13:43 +00:00
|
|
|
```shell
|
2024-06-08 11:32:45 +00:00
|
|
|
docker build -f Dockerfile.source --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.16 .
|
2024-03-08 05:05:23 +00:00
|
|
|
```
|
|
|
|
|
2024-05-27 05:10:15 +00:00
|
|
|
Use latest version instead of `1.4.16`.
|
2024-04-23 06:53:58 +00:00
|
|
|
|
2024-05-27 05:10:15 +00:00
|
|
|
The image that is built is light and safe. It is based on Alpine Linux with the Quilibrium node binary, no
|
2024-03-08 05:05:23 +00:00
|
|
|
source code, nor the Go development environment. The image also has the `grpcurl` tool that can be used to
|
|
|
|
query the gRPC interface.
|
|
|
|
|
|
|
|
### Task
|
|
|
|
|
2024-05-27 05:10:15 +00:00
|
|
|
You can also use the [Task](https://taskfile.dev/) tool, it is a simple build tool that takes care of extracting
|
|
|
|
parameters and building the image. The tasks are all defined in [Taskfile.yaml](Taskfile.yaml).
|
2024-03-08 05:05:23 +00:00
|
|
|
|
|
|
|
You can optionally create an `.env` file, in the same repository root folder to override specific parameters. Right now
|
|
|
|
only one optional env var is supported and that is `QUILIBRIUM_IMAGE_NAME`, if you want to change the default
|
2024-05-27 05:10:15 +00:00
|
|
|
image name from `quilibrium` to something else. If you are pushing your images to GitHub then you have to follow the
|
|
|
|
GitHub naming convention and use a name like `ghcr.io/mscurtescu/ceremonyclient`.
|
2024-03-08 05:05:23 +00:00
|
|
|
|
2024-05-27 05:10:15 +00:00
|
|
|
Bellow there are example interactions with `Task`.
|
2024-03-08 05:05:23 +00:00
|
|
|
|
|
|
|
The node version is extracted from [node/main.go](node/main.go). This version string is used to tag the image. The git
|
2024-05-27 05:10:15 +00:00
|
|
|
repo, branch and commit are read through the `git` command and depend on the current state of your working
|
|
|
|
directory (on what branch and at what commit you are). These last three values are used to label the image.
|
2024-03-08 05:05:23 +00:00
|
|
|
|
|
|
|
List tasks:
|
|
|
|
```shell
|
|
|
|
task -l
|
2024-02-20 23:13:43 +00:00
|
|
|
```
|
|
|
|
|
2024-03-08 05:05:23 +00:00
|
|
|
Show what parameters, like image name, version etc, will be used:
|
|
|
|
```shell
|
|
|
|
task status
|
|
|
|
```
|
2024-02-20 23:13:43 +00:00
|
|
|
|
2024-03-08 05:05:23 +00:00
|
|
|
Build the image (aka run the `build` task):
|
|
|
|
```shell
|
|
|
|
task build
|
|
|
|
```
|
2024-02-20 23:13:43 +00:00
|
|
|
|
|
|
|
## Run
|
|
|
|
|
2024-05-27 05:10:15 +00:00
|
|
|
In order to run a Quilibrium node using the docker image follow the instructions in the [docker](docker) subfolder.
|