mirror of
https://github.com/valitydev/dominant.git
synced 2024-11-06 02:25:17 +00:00
TD-6: Replace rbkmoney build image with common one (#4)
* TD-6: Decouple from rbkmoney build image * Add env variables to build CI * Fix image name * Try to fix arg * Import .env in Makefile * Add args to docker step * Fix build-args format * Fix typo * Add setup buildx to CI
This commit is contained in:
parent
7c026e2973
commit
8bd7828fc0
5
.env
5
.env
@ -2,6 +2,5 @@
|
||||
# You SHOULD specify point releases here so that build time and run time Erlang/OTPs
|
||||
# are the same. See: https://github.com/erlware/relx/pull/902
|
||||
ERLANG_VERSION=24.2.0
|
||||
THRIFT_VERSION=0.14.2.1
|
||||
|
||||
DOCKER_BUILDKIT=1
|
||||
THRIFT_VERSION=0.14.2.2
|
||||
SERVICE=dominant
|
||||
|
11
.github/workflows/build-image.yaml
vendored
11
.github/workflows/build-image.yaml
vendored
@ -31,9 +31,20 @@ jobs:
|
||||
tags: |
|
||||
type=sha
|
||||
|
||||
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
|
||||
- name: Update environment variables
|
||||
run: grep -v '^#' .env >> $GITHUB_ENV
|
||||
|
||||
- name: Setup Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
with:
|
||||
push: ${{ github.event_name == 'push' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
ERLANG_VERSION=${{ env.ERLANG_VERSION }}
|
||||
THRIFT_VERSION=${{ env.THRIFT_VERSION }}
|
||||
SERVICE=${{ env.SERVICE }}
|
||||
|
15
Dockerfile
15
Dockerfile
@ -1,13 +1,20 @@
|
||||
FROM ghcr.io/rbkmoney/build-erlang:785d48cbfa7e7f355300c08ba9edc6f0e78810cb AS builder
|
||||
ARG ERLANG_VERSION
|
||||
|
||||
FROM erlang:${ERLANG_VERSION} AS builder
|
||||
|
||||
ARG THRIFT_VERSION
|
||||
ARG BUILDARCH
|
||||
RUN wget -q -O- "https://github.com/valitydev/thrift/releases/download/${THRIFT_VERSION}/thrift-${THRIFT_VERSION}-linux-${BUILDARCH}.tar.gz" \
|
||||
| tar -xvz -C /usr/local/bin/
|
||||
|
||||
RUN mkdir /build
|
||||
COPY . /build/
|
||||
WORKDIR /build
|
||||
RUN rebar3 compile
|
||||
RUN rebar3 as prod release
|
||||
|
||||
# Keep in sync with Erlang/OTP version in build image
|
||||
FROM erlang:24.1.3.0-slim
|
||||
ENV SERVICE=dominant
|
||||
FROM erlang:${ERLANG_VERSION}-slim
|
||||
ARG SERVICE
|
||||
ENV CHARSET=UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
COPY --from=builder /build/_build/prod/rel/${SERVICE} /opt/${SERVICE}
|
||||
|
Loading…
Reference in New Issue
Block a user