Skip to content

Commit

Permalink
README/Update
Browse files Browse the repository at this point in the history
  • Loading branch information
NotCompsky committed Dec 6, 2020
1 parent e4f8044 commit 1fe4d47
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions COMPILING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
## Docker

### Normal Build

This build uses shared binaries etc.

docker build -t notcompsky/tagem --build-arg TAGEM_ROOT_DIR="$PWD" .
docker run --env TAGEM_MYSQL_CFG="$TAGEM_MYSQL_CFG" -p 80:80 -v /media:/media -v /home:/home -v /var/run/mysqld/:/var/run/mysqld/ notcompsky/tagem

### Single Binary Build

Not entirely static yet.

This build uses a custom docker image where the entire dependency chain is in static libraries, rather than dynamically linked. The resulting binary can run on any Linux platform with the same type of CPU (e.g. x86 or x64).

Docker's build permissions means that one cannot `COPY` from the host unless the files are in the same context as the Dockerfile. Piping a Dockerfile from stdin, and using softlinks/hardlinks do not work around this. Dockerfiles cannot be named custom things.

Hence, in order to build the static (alpine/musl) single binary build, one must switch out [the main Dockerfile](Dockerfile) with [the musl Dockerfile](wangle-server/docker/musl/Dockerfile).

mv Dockerfile Dockerfile.main
mv wangle-server/docker/musl/Dockerfile Dockerfile
docker build -t notcompsky/tagem-min .
mv Dockerfile wangle-server/docker/musl/Dockerfile
mv Dockerfile.main Dockerfile

To copy the binary from the image, you must create a dummy container and copy from that:

docker create -ti --name dummy notcompsky/tagem-min bash
docker cp dummy:/tagem/build/server ./tagem-server
docker cp dummy:/tagem-server ./tagem-server
docker rm -f dummy

## Non-Docker
Expand Down

0 comments on commit 1fe4d47

Please sign in to comment.