Skip to content

Commit

Permalink
doc/CONTAINER-BUILD.md: Adjust to recent change in make-binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
sando38 committed Aug 1, 2023
1 parent 1cb584b commit 115e557
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
30 changes: 8 additions & 22 deletions doc/CONTAINER-BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,10 @@ describe the default build process defined by the build arguments in the
From the root of the repository, to build with `local` source files the
`docker buildx build` or `podman build` command is:

```shell
docker buildx build --load \
-f Dockerfile \
-t myname/eturnal:mytag \
--build-arg METHOD='build' \
--build-arg SOURCE='local' \
.
```
docker buildx build --load -t myname/eturnal:mytag .

Omitting `--build-arg METHOD='build'` and `--build-arg SOURCE='local'` in the
example above would lead to the same result, because they are the default.
No need to set `--build-arg METHOD='build'` and `--build-arg SOURCE='local'` in
the example above as those are the default values.

Instead, if the source files should be downloaded from github and a specific
version should be built (`VERSION=master` is default), the build command would
Expand All @@ -54,7 +47,6 @@ be:
docker buildx build --load \
-f Dockerfile \
-t myname/eturnal:mytag \
--build-arg METHOD='build' \
--build-arg SOURCE='git' \
--build-arg REPOSITORY='https://github.com/processone/eturnal' \
--build-arg VERSION='1.10.1' \
Expand All @@ -69,7 +61,6 @@ the [official archive](https://eturnal.net/download/).
docker buildx build --load \
-f Dockerfile \
-t myname/eturnal:mytag \
--build-arg METHOD='build' \
--build-arg SOURCE='web' \
--build-arg VERSION='1.10.1' \
.
Expand All @@ -92,30 +83,25 @@ docker buildx build --load \
## Building eturnal tarballs for musl-libc with Docker or Podman

You can use the `Dockerfile.ctng` in this directory to build eturnal tarballs
with the `make-binaries` script.
with our `make-binaries` script.

From the root of the eturnal repository, do:

```shell
docker build \
-f tools/Dockerfile.ctng \
-t localhost/myname/ctng:eturnal \
.
```
docker build -f tools/Dockerfile.ctng -t localhost/myname/ctng:eturnal .

Building tarballs for `musl-libc` with the Debian-based `Dockerfile.ctng` image
requires a bootstrapped erlang based on the docker host machine's architecture,
hence, `$(uname -m)-linux-gnu` in the targets below.

```shell
targets="$(uname -m)-linux-gnu $(uname -m)-linux-musl"
sed -i "s|targets='.*'|targets='$targets'|" $PWD/tools/make-binaries
docker run --rm -d \
docker run --rm -d \
--name ctng-eturnal \
--user $(id -u $(whoami)) \
-v ctng:/ctng \
-v $PWD:/eturnal \
localhost/myname/ctng:eturnal
localhost/myname/ctng:eturnal \
$targets
docker logs -f ctng-eturnal
```

Expand Down
13 changes: 6 additions & 7 deletions tools/Dockerfile.ctng
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM debian AS build
ENV DEBIAN_FRONTEND='noninteractive' \
DEBCONF_NONINTERACTIVE_SEEN='true' \
BUILD_DIR='/ctng' \
CHECK_DEPS='false'
FROM docker.io/library/debian:bookworm AS build
ARG DEBIAN_FRONTEND='noninteractive' \
DEBCONF_NONINTERACTIVE_SEEN='true'

RUN apt-get update \
&& apt-get install -y gcc g++ gperf bison flex texinfo help2man make \
libncurses5-dev python3-dev autoconf automake libtool libtool-bin gawk \
wget bzip2 xz-utils unzip patch libstdc++6 rsync git meson ninja-build \
curl makeself tini vim wget lynx

ENV BUILD_DIR='/ctng' \
CHECK_DEPS='false'
WORKDIR /eturnal

ENTRYPOINT ["/usr/bin/tini","--"]
CMD ["/eturnal/tools/make-binaries"]
ENTRYPOINT ["/usr/bin/tini","--","/eturnal/tools/make-binaries"]

0 comments on commit 115e557

Please sign in to comment.