forked from pmq20/ruby-packer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: bundle install so we can fetch src
- Loading branch information
Showing
11 changed files
with
143 additions
and
33 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
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
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,86 @@ | ||
|
||
ARG ALPINE_VERSION=3.18 | ||
FROM alpine:${ALPINE_VERSION} as stage1 | ||
ARG ALPINE_VERSION=3.18 | ||
ENV ALPINE_VERSION=$ALPINE_VERSION | ||
ARG RUBY_VERSION=3.2.2 | ||
ENV RUBY_VERSION=${RUBY_VERSION} | ||
# open ssl 1.1 from 3.16 and below | ||
# open ssl 3.0 support only added in linux 3.17 onwards https://debugpointnews.com/alpine-linux-3-17/ | ||
# open ssl 3.1 from 3.18 | ||
|
||
# Setup build environment for rubyc | ||
RUN apk add --no-cache \ | ||
build-base \ | ||
openssl-dev \ | ||
readline-dev \ | ||
zlib-dev \ | ||
yaml-dev \ | ||
libffi-dev \ | ||
gdbm-dev \ | ||
ncurses-dev \ | ||
procps \ | ||
wget \ | ||
tar \ | ||
squashfs-tools \ | ||
git \ | ||
mariadb-dev \ | ||
postgresql-dev \ | ||
sqlite sqlite-dev sqlite-libs \ | ||
autoconf \ | ||
xz && \ | ||
apk cache clean && \ | ||
rm -rf /var/cache/apk/* && \ | ||
rm -rf /tmp/* && \ | ||
rm -rf /var/log/* | ||
|
||
# gcompat && \ # only required for pact broker due to nokogiri | ||
|
||
## Install ruby from source | ||
RUN wget https://cache.ruby-lang.org/pub/ruby/$(echo $RUBY_VERSION | cut -d '.' -f 1,2)/ruby-${RUBY_VERSION}.tar.gz && \ | ||
tar -xzvf ruby-${RUBY_VERSION}.tar.gz && \ | ||
rm -rf ruby-${RUBY_VERSION}.tar.gz && \ | ||
cd ruby-${RUBY_VERSION} && \ | ||
OPENSSL_DIR=$(pkg-config --variable=prefix openssl) ./configure \ | ||
--disable-shared \ | ||
--enable-static \ | ||
--prefix=/usr/local/ruby-${RUBY_VERSION} \ | ||
--with-openssl-dir=$(pkg-config --variable=prefix openssl) && \ | ||
make && \ | ||
make install | ||
ENV PATH="/usr/local/ruby-${RUBY_VERSION}/bin:$PATH" | ||
RUN ruby -v | ||
|
||
WORKDIR /app | ||
COPY ruby-enclose ./ruby-enclose | ||
COPY vendor-enclose ./vendor-enclose | ||
COPY ruby-enclose-${RUBY_VERSION}-patch ./ruby-enclose-${RUBY_VERSION}-patch | ||
COPY bin ./bin | ||
COPY lib ./lib | ||
COPY rakelib ./rakelib | ||
COPY Gemfile . | ||
COPY Rakefile . | ||
COPY test ./test | ||
RUN bundle install | ||
RUN if [ "$(echo $ALPINE_VERSION | cut -d '.' -f 2)" -le "16" ] ; then OPENSSL_VERSION=1.1.1v bundle exec rake patch_ruby_source; fi | ||
RUN if [ "$(echo $ALPINE_VERSION | cut -d '.' -f 2)" -eq "17" ] ; then OPENSSL_VERSION=3.0.10 bundle exec rake patch_ruby_source; fi | ||
RUN if [ "$(echo $ALPINE_VERSION | cut -d '.' -f 2)" -ge "18" ] ; then OPENSSL_VERSION=3.1.2 bundle exec rake patch_ruby_source; fi | ||
# RUN bundle exec rake patch_ruby_source | ||
WORKDIR /app/examples/pact | ||
COPY examples/pact . | ||
RUN bundle lock --add-platform aarch64-linux-musl && \ | ||
bundle install | ||
RUN bundle exec pact-mock-service help | ||
RUN ruby pact-cli.rb | ||
RUN /app/bin/rubyc pact-cli.rb -o pact-cli | ||
RUN mv /app/examples/pact/pact-cli /usr/local/bin/pact-cli | ||
ENTRYPOINT [ "pact-cli" ] | ||
CMD [ "--help" ] | ||
|
||
FROM alpine:3.18 as stage2 | ||
|
||
COPY --from=stage1 /usr/local/bin/pact-cli /usr/local/bin/pact-cli | ||
WORKDIR /app | ||
COPY examples/pact . | ||
ENTRYPOINT [ "pact-cli" ] | ||
CMD [ "--help" ] |
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
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