Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
ci: build linux binary on alpine with static linking (#60)
* ci: would this work? * ci: add docker:// to release pipeline * ci: add artifacts to test ppx on alpine * ci: try static linking * ci: try static linking * ci: are we in alpine? how this works? * ci: are we in alpine? how this works? * ci: are we in alpine? how this works? * ci: are we in alpine? how this works? * ci: are we in alpine? how this works? * ci: try container action * ci: try custom container for building alpine image * ci: adjust release workflow to use docker container
- Loading branch information
Showing
7 changed files
with
146 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
################################################################################ | ||
# Dockerfile used for building linux/alpine binary | ||
# taken from https://github.com/anmonteiro/gh-feed-reader/blob/master/Dockerfile | ||
################################################################################ | ||
|
||
# start from node image so we can install esy from npm | ||
FROM node:12-alpine as build | ||
|
||
ENV TERM=dumb LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib | ||
|
||
RUN mkdir /esy | ||
WORKDIR /esy | ||
|
||
ENV NPM_CONFIG_PREFIX=/esy | ||
RUN npm install -g --unsafe-perm @esy-nightly/esy | ||
|
||
# now that we have esy installed we need a proper runtime | ||
|
||
FROM alpine:3.8 as esy | ||
|
||
ENV TERM=dumb LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib | ||
|
||
WORKDIR / | ||
|
||
COPY --from=build /esy /esy | ||
|
||
RUN apk add --no-cache ca-certificates wget bash curl perl-utils git patch \ | ||
gcc g++ musl-dev make m4 linux-headers coreutils | ||
|
||
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub | ||
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk | ||
RUN apk add --no-cache glibc-2.28-r0.apk | ||
|
||
ENV PATH=/esy/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(lang dune 1.1) | ||
|
||
(env (release-static (flags (:standard -ccopt -static)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters