1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-11-22 10:20:11 +00:00

add docker notes

Harvey Tindall 2021-02-16 18:03:55 +00:00
parent 4eabfa2713
commit 8e5ff7da8e

@ -1,3 +1,20 @@
## Docker
For multiarch support, the provided `Dockerfile` uses Docker [buildx](https://github.com/docker/buildx), which means you can't just build it with your regular `docker build`. To use it, you need to enable experimental features in `/etc/docker/daemon.json`, `$HOME/.docker/config.json` or by setting the environment variable `DOCKER_CLI_EXPERIMENTAL=enabled`.
```shell
⟩ cat /etc/docker/daemon.json
{
"experimental": true
}
```
You should then be able to run `docker buildx` and get a help page. If not, see the [build instructions](https://github.com/docker/buildx#building) to manually install it.
To build and load the container, you can then run
```
⟩ git clone https://github.com/hrfee/jfa-go.git
⟩ cd jfa-go/
⟩ docker buildx build -t hrfee/jfa-go:unstable --load .
```
## Native
To build, you need to compile the typescript and go, and generate email templates and config files. The build scripts were mostly ripped out of jf-accounts, so you'll need similar dependencies: To build, you need to compile the typescript and go, and generate email templates and config files. The build scripts were mostly ripped out of jf-accounts, so you'll need similar dependencies:
``` ```
git git
@ -11,6 +28,8 @@ The main dependencies of the program will be automatically downloaded on compila
### Makefile ### Makefile
A Makefile is provided, which requires the `make` command. Simply clone the repository and run `make all` to grab all necessary dependencies for go/python/node, compile everything and place the executable and app data inside `build/`. You can optionally compress the executable by running `make compress` after. A Makefile is provided, which requires the `make` command. Simply clone the repository and run `make all` to grab all necessary dependencies for go/python/node, compile everything and place the executable and app data inside `build/`. You can optionally compress the executable by running `make compress` after.
* If you get an error from npm regarding esbuild, this is because a precompiled binary for your system's architecture isn't available on npm. run `make all GOESBUILD=on` instead to have it compiled instead.
### Goreleaser ### Goreleaser
[goreleaser](https://github.com/goreleaser/goreleaser) is used to publish the packages seen in the release section. [goreleaser](https://github.com/goreleaser/goreleaser) is used to publish the packages seen in the release section.
* To generate executables for multiple platforms, run `goreleaser build --snapshot --rm-dist`. They will be stored in `dist/`. The `data/` directory must be manually copied into the same directory as the executable for it to run. * To generate executables for multiple platforms, run `goreleaser build --snapshot --rm-dist`. They will be stored in `dist/`. The `data/` directory must be manually copied into the same directory as the executable for it to run.