add Dockerfile for building chat executable and instructions on running it (#48)

* [WIP] add instructions how to build project inside docker container

* docker run -> docker create

* add Dockerfile for building chat executable and instructions
This commit is contained in:
Efim Poberezkin
2021-02-21 19:59:52 +04:00
parent 2ad54cf1d3
commit b5bfa3ac8c
2 changed files with 26 additions and 5 deletions

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM haskell:8.8.4 AS build-stage
# if you encounter "version `GLIBC_2.28' not found" error when running
# chat client executable, build with the following base image instead:
# FROM haskell:8.8.4-stretch AS build-stage
COPY . /project
WORKDIR /project
RUN stack install
FROM scratch AS export-stage
COPY --from=build-stage /root/.local/bin/dog-food /

View File

@@ -34,19 +34,30 @@ $ stack install
$ dog-food
```
If you'd prefer to not set up Haskell locally, you may instead build the chat client executable using [docker build with custom output](https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs):
```shell
$ git clone git@github.com:simplex-chat/simplex-messaging.git
$ cd simplex-messaging
$ DOCKER_BUILDKIT=1 docker build --output ~/.local/bin .
$ dog-food
```
> **NOTE:** when running chat client executable built with the latter approach, if you encounter ``version `GLIBC_2.28' not found`` error, rebuild it with `haskell:8.8.4-stretch` base image instead (you'd have to change it in your local [Dockerfile](Dockerfile)).
`dog-food` (as in "eating your own dog food" - it is an early prototype) starts chat client with default parameters. By default, SQLite database file is created in the working directory (`smp-chat.db`), and the default SMP server is `smp.simplex.im:5223`.
To specify a different chat database location run:
```bash
mkdir ~/simplex
dog-food -d ~/simplex/my-chat.db
```shell
$ mkdir ~/simplex
$ dog-food -d ~/simplex/my-chat.db
```
You can deploy your own server and set client to use it via command line option:
```bash
dog-food -s smp.example.com:5223
```shell
$ dog-food -s smp.example.com:5223
```
You can still talk to people using default or any other server, it only affects the location of the message queue when you initiate the connection (and the reply queue can be on another server, as set by the other party's client).