Skip to content

Commit

Permalink
Dockerfile: allow overriding def cmd via env var
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Turner <dylan.turner@tutanota.com>
  • Loading branch information
blueOkiris committed Aug 24, 2024
1 parent 135e771 commit c820835
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ RUN apt-get update && apt-get install -y \

# Set up environment to build for Debian
WORKDIR /proj
ENV COMMAND="build"
RUN \
LATEST_TAG=$(curl -s https://api.github.com/repos/blueOkiris/acbs/releases/latest | jq -r .tag_name) \
&& curl \
-L -o acbs-${LATEST_TAG}.linux-x86_64 \
https://github.com/blueOkiris/acbs/releases/download/${LATEST_TAG}/acbs-${LATEST_TAG}.linux-x86_64 \
&& chmod +x acbs-${LATEST_TAG}.linux-x86_64 \
&& mv acbs-${LATEST_TAG}.linux-x86_64 /usr/bin/acbs
ENTRYPOINT [ "acbs", "build" ]
ENTRYPOINT [ "sh", "-c", "acbs ${COMMAND}" ]

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ You can optionally specify the folder containing an acbs.ini by providing it as

Use docker. We have a Dockerfile in the main directory which will build an x86\_64 Linux compatible binary via Debian

Build Image: `docker build -t acbs-bldr .`
Run Image: `docker run --rm -v .:/proj -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) acbs-bldr`
Build Image: `docker build --no-cache -t acbs-bldr .`
Run Image:

- Build: `docker run --rm -v .:/proj -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) acbs-bldr`
- Debug Build: `docker run -e COMMAND=debug --rm -v .:/proj -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) acbs-bldr`
- Clean: `docker run -e COMMAND=clean --rm -v .:/proj -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) acbs-bldr`

0 comments on commit c820835

Please sign in to comment.