File tree Expand file tree Collapse file tree 2 files changed +29
-19
lines changed Expand file tree Collapse file tree 2 files changed +29
-19
lines changed Original file line number Diff line number Diff line change 22
22
- name : Checkout
23
23
uses : actions/checkout@v4
24
24
25
- - name : Set up QEMU
26
- uses : docker/setup-qemu-action@v2
27
-
28
25
- name : Set up Docker Buildx
29
26
uses : docker/setup-buildx-action@v2
30
27
@@ -42,12 +39,16 @@ jobs:
42
39
43
40
- name : Build and push platform image
44
41
uses : docker/build-push-action@v5
42
+ env :
43
+ CRYSTAL_WORKERS : ${{ matrix.platform == 'linux/amd64' && 4 || 2 }}
45
44
with :
46
45
context : .
47
46
platforms : ${{ matrix.platform }}
48
47
push : true
49
48
tags : |
50
49
sjdonado/bit:${{ github.event_name == 'release' && steps.version.outputs.version || 'latest' }}-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
50
+ build-args : |
51
+ TARGETARCH=${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
51
52
cache-from : type=gha
52
53
cache-to : type=gha,mode=max
53
54
Original file line number Diff line number Diff line change 1
- FROM alpine:edge AS build
1
+ FROM debian:bookworm-slim AS build
2
2
3
+ ARG TARGETARCH
3
4
ENV ENV=production
4
5
WORKDIR /usr/src/app
5
6
6
- RUN apk update && apk add --no-cache \
7
+ RUN apt-get update && apt-get install -y \
8
+ curl \
9
+ gnupg \
10
+ ca-certificates \
11
+ && mkdir -p /etc/apt/keyrings \
12
+ && curl -fsSL https://packagecloud.io/84codes/crystal/gpgkey | gpg --dearmor > /etc/apt/trusted.gpg.d/84codes_crystal.gpg \
13
+ && echo "deb [signed-by=/etc/apt/trusted.gpg.d/84codes_crystal.gpg] https://packagecloud.io/84codes/crystal/debian/ bookworm main" > /etc/apt/sources.list.d/84codes_crystal.list
14
+
15
+ RUN apt-get update && apt-get install -y \
7
16
crystal \
8
- shards \
9
- yaml-dev \
10
- sqlite-dev \
11
- openssl-dev
17
+ libssl-dev \
18
+ libyaml-dev \
19
+ libsqlite3-dev \
20
+ libevent-dev \
21
+ && rm -rf /var/lib/apt/lists/*
12
22
13
23
COPY . .
14
24
15
- RUN shards install
16
- RUN shards build --release --no-debug
25
+ RUN shards install --production
26
+ RUN shards build --release --no-debug --progress --stats
17
27
18
- FROM alpine:edge AS runtime
28
+ FROM debian:bookworm-slim AS runtime
19
29
20
30
ENV ENV=production
21
31
WORKDIR /usr/src/app
22
32
23
- RUN apk add --no-cache \
24
- gc \
25
- pcre2 \
26
- libevent \
27
- yaml \
28
- sqlite-libs \
29
- openssl
33
+ RUN apt-get update && apt-get install -y \
34
+ libssl3 \
35
+ libyaml-0-2 \
36
+ libsqlite3-0 \
37
+ libevent-2.1-7 \
38
+ && rm -rf /var/lib/apt/lists/*
30
39
31
40
RUN mkdir -p sqlite
32
41
You can’t perform that action at this time.
0 commit comments