Skip to content

Commit

Permalink
add Dockerfile and 'make docker' target to create a Docker image. fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed May 7, 2022
1 parent f7306fc commit 614d6a9
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 9 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@ jobs:
image: 'erlang:${{ matrix.otp_vsn }}'
steps:
- shell: bash
run: |
apt-get update
apt-get -y install tcl tcl-dev gettext
cd /usr/src/
wget https://github.com/git/git/archive/v2.18.0.tar.gz -O git.tar.gz
tar -xf git.tar.gz
cd git-*
make prefix=/usr/local all
make prefix=/usr/local install
run: ./Dockerfile.build.sh
- uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1
ARG FROM
FROM ${FROM}

LABEL maintainer="[email protected]"
LABEL vendor="Y Software AB"
LABEL url="https://github.com/for-get/jesse"
LABEL vcs-url="https://github.com/for-get/jesse"
ARG LABEL_VCS_REF="0"
LABEL vcs-ref=${LABEL_VCS_REF}
ARG LABEL_BUILD_DATE="1970-01-01T00:00:00Z"
LABEL build-date=${LABEL_BUILD_DATE}



COPY . /jesse
RUN cd /jesse && ./Dockerfile.build.sh
RUN cd /jesse && make

CMD /bin/jesse
15 changes: 15 additions & 0 deletions Dockerfile.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

apt-get update
apt-get -y install tcl tcl-dev gettext
cd /usr/src/
wget https://github.com/git/git/archive/v2.18.0.tar.gz -O git.tar.gz
tar -xf git.tar.gz
(
cd git-*
make prefix=/usr/local all
make prefix=/usr/local install
)
rm git.tar.gz
rm -r git-*
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,18 @@ rebar3.OTP23:
.PHONY: rebar3.OTP24
rebar3.OTP24:
$(LN) -sf rebar3.OTP22 $@

.PHONY: docker
docker:
# docker context create aws-docker-amd64 --docker host=ssh://ec2-13-51-198-153.eu-north-1.compute.amazonaws.com
# docker context create aws-docker-arm64 --docker host=ssh://ec2-13-48-46-86.eu-north-1.compute.amazonaws.com
# docker buildx create --name aws-multiarch-builder aws-docker-amd64
# docker buildx create --name aws-multiarch-builder --append aws-docker-arm64
# docker use aws-multiarch-builder
docker buildx build . \
--push \
--platform linux/amd64,linux/arm64 \
--tag ysoftwareab/jesse:$$(git describe --tags --first-parent --always) \
--build-arg FROM=erlang:latest \
--build-arg LABEL_VCS_REF=$$(git rev-parse HEAD) \
--build-arg LABEL_BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ")

0 comments on commit 614d6a9

Please sign in to comment.