tangled
alpha
login
or
join now
futur.blue
/
pegasus
57
fork
atom
objective categorical abstract machine language personal data server
57
fork
atom
overview
issues
2
pulls
pipelines
Update dockerfile to use alpine
futur.blue
2 months ago
8eec7e70
892efdd9
verified
This commit was signed with the committer's
known signature
.
futur.blue
SSH Key Fingerprint:
SHA256:QHGqHWNpqYyw9bt8KmPuJIyeZX9SZewBZ0PR1COtKQ0=
+21
-11
2 changed files
expand all
collapse all
unified
split
.github
workflows
build.yml
Dockerfile
+9
-2
.github/workflows/build.yml
···
21
21
- name: Set up Docker Buildx
22
22
uses: docker/setup-buildx-action@v3
23
23
24
24
-
- name: Set GIT_REV
25
25
-
run: echo "GIT_REV=`git rev-parse --short HEAD`" >> $GITHUB_ENV
24
24
+
- uses: actions/checkout@v6
25
25
+
with:
26
26
+
sparse-checkout: |
27
27
+
.git
28
28
+
29
29
+
- name: Set short git commit SHA
30
30
+
run: |
31
31
+
short_sha=$(git rev-parse --short ${{ github.sha }})
32
32
+
echo "COMMIT_SHORT_SHA=$short_sha" >> $GITHUB_ENV
26
33
27
34
- name: Build and push
28
35
uses: docker/build-push-action@v6
+12
-9
Dockerfile
···
1
1
-
FROM ocaml/opam:debian-12-ocaml-5.2 AS build
1
1
+
FROM ocaml/opam:alpine-3.22-ocaml-5.2 AS build
2
2
3
3
ARG NODE_VERSION=v24.11.1
4
4
ARG OPAM_VERSION=2.5.0
···
7
7
ARG GIT_REV
8
8
ENV GIT_REV=$GIT_REV
9
9
10
10
-
RUN sudo apt-get install -y cmake git libev-dev libffi-dev libgmp-dev libssl-dev libsqlite3-dev libpcre3-dev pkg-config
10
10
+
USER root
11
11
+
RUN apk add --no-cache cmake git libev-dev libffi-dev gmp-dev openssl-dev sqlite-dev pcre-dev pkgconfig
12
12
+
13
13
+
RUN bash -c "curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh | bash -s -- --version $OPAM_VERSION"
14
14
+
RUN bash -c "chown opam:opam /usr/bin/opam"
15
15
+
USER opam
11
16
12
17
WORKDIR /home/opam/pegasus
13
18
···
17
22
ENV CI=true
18
23
19
24
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm alias default $NODE_VERSION && nvm use default && corepack enable pnpm"
20
20
-
21
21
-
RUN bash -c "curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh | bash -s -- --version $OPAM_VERSION"
22
25
23
26
ADD . .
24
27
···
29
32
RUN opam exec dune pkg lock
30
33
RUN bash -c "source $NVM_DIR/nvm.sh && opam exec dune build -- --release --stop-on-first-error"
31
34
32
32
-
FROM debian:12 AS run
35
35
+
FROM alpine:3.22 AS run
33
36
34
34
-
RUN apt-get update && apt-get install -y ca-certificates libev-dev libffi-dev libgmp-dev libssl-dev libsqlite3-dev libpcre3-dev netbase pkg-config
37
37
+
RUN apk add --no-cache ca-certificates cmake git libev-dev libffi-dev gmp-dev openssl-dev sqlite-dev pcre-dev pkgconfig
35
38
36
39
RUN mkdir /data
37
40
38
38
-
COPY --from=build /home/opam/pegasus/_build/default/bin/main.exe /bin/pegasus
39
39
-
COPY --from=build /home/opam/pegasus/_build/default/bin/gen_keys.exe /bin/gen-keys
41
41
+
COPY --from=build /home/opam/pegasus/_build/default/bin/main.exe /usr/bin/pegasus
42
42
+
COPY --from=build /home/opam/pegasus/_build/default/bin/gen_keys.exe /usr/bin/gen-keys
40
43
41
41
-
ENTRYPOINT ["/bin/pegasus"]
44
44
+
ENTRYPOINT ["/usr/bin/pegasus"]
42
45
43
46
LABEL org.opencontainers.image.source=https://tangled.org/futur.blue/pegasus
44
47
LABEL org.opencontainers.image.description="pegasus, an atproto pds"