Skip to content

Commit 47ab321

Browse files
committed
entrypoint and error message
1 parent 2e33892 commit 47ab321

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,4 @@ buildah:
351351
mkdir -p .stack-root-buildah
352352
mkdir -p .stack-work-buildah
353353
mkdir -p dist-buildah
354-
stack install . --local-bin-path=dist-buildah --work-dir=.stack-work-buildah --stack-root=${CURDIR}/.stack-root-buildah
354+
stack install . --local-bin-path=dist-buildah --work-dir=.stack-work-buildah --stack-root=${CURDIR}/.stack-root-buildah --fast

build/alpine/buildah.sh

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,37 @@ buildah containers | awk '{print $5}' | grep "$CONTAINER_NAME" \
1818
ls "$TOP_LEVEL/.stack-root-buildah/config.yaml" 2> /dev/null \
1919
|| buildah run "$CONTAINER_NAME" -- cp -a /root/.stack/. /src/.stack-root-buildah/
2020

21-
buildah run "$CONTAINER_NAME" -- make -C /src buildah
21+
# buildah run "$CONTAINER_NAME" -- make -C /src buildah
2222

2323
#######
2424

25-
CONTAINER_NAME="output"
2625
EXECUTABLE="cannon"
26+
CONTAINER_NAME="output"
2727
DOCKER_TAG=$USER
2828

29-
buildah from --name "$CONTAINER_NAME" -v "${TOP_LEVEL}"/buildah-dist:/dist -v "${TOP_LEVEL}"/services/brig/deb/opt/brig/templates:/templates --pull quay.io/wire/alpine-deps:develop
30-
buildah run "$CONTAINER_NAME" -- cp "/dist/$EXECUTABLE" "/usr/bin/$EXECUTABLE"
31-
# buildah run "$CONTAINER_NAME" -- cp -r "/templates/." "/usr/share/wire/templates/"
29+
buildah containers | awk '{print $5}' | grep "$CONTAINER_NAME" \
30+
|| buildah from --name "$CONTAINER_NAME" -v "${TOP_LEVEL}":/src --pull quay.io/wire/alpine-deps:develop
31+
32+
buildah run "$CONTAINER_NAME" -- sh -c 'mkdir -p /usr/share/wire/templates && cp -r "/src/services/brig/deb/opt/brig/templates" "/usr/share/wire/templates"'
33+
buildah run "$CONTAINER_NAME" -- cp "/src/dist/$EXECUTABLE" "/usr/bin/$EXECUTABLE"
34+
buildah config --entrypoint "[ \"/usr/bin/dumb-init\", \"--\", \"/usr/bin/$EXECUTABLE\" ]" "$CONTAINER_NAME"
3235
buildah commit "$CONTAINER_NAME" quay.io/wire/"$EXECUTABLE":"$DOCKER_TAG"
36+
37+
# TODO HELP!
38+
# buldah push quay.io/wire/cannon:$USER works and uploads it to quay.io
39+
# also, inside the image, /usr/bin/cannon exists, is a 43 MB file, ldd shows it has the right linker libs, it's executable, but running /usr/bin/cannon leads to:
40+
# sh: /usr/bin/cannon: not found
41+
# providing config files under /etc/wire/cannon/ doesn't help.
42+
43+
44+
# If the above works, continue with logic like the following:
45+
46+
# buildah run "$CONTAINER_NAME" -- rm "/usr/bin/$EXECUTABLE"
47+
48+
# loop: remove cannon, add new executable
49+
# for EX in brig cargohold galley; do
50+
# buildah run "$CONTAINER_NAME" -- cp "/src/dist/$EX" "/usr/bin/$EX"
51+
# buildah config --entrypoint "[ \"/usr/bin/dumb-init\", \"--\", \"/usr/bin/$EX\" ]" "$CONTAINER_NAME"
52+
# buildah commit "$CONTAINER_NAME" quay.io/wire/"$EXECUTABLE":"$DOCKER_TAG"
53+
# buildah run "$CONTAINER_NAME" -- rm "/usr/bin/$EX"
54+
# done

0 commit comments

Comments
 (0)