Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker build for linux release. #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .docker/linux-release.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM ubuntu:18.04 as build

ARG CURL_VERSION=7.88.1

# Upgrade all packages and install dependencies
RUN apt-get update \
&& apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \
ca-certificates \
openjdk-17-jdk \
openssh-client \
libgnutls28-dev \
libsqlite3-dev \
build-essential \
git \
wget \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /curl
RUN wget https://curl.se/download/curl-${CURL_VERSION}.tar.bz2 \
&& tar -xjvf curl-${CURL_VERSION}.tar.bz2 \
&& cd curl-${CURL_VERSION} \
&& ./configure --with-gnutls=/lib/x86_64-linux-gnu/ \
&& make \
&& make install \
&& ldconfig

# Copy phoenixd source
WORKDIR /phoenixd
COPY . .

# Build
RUN \
--mount=type=cache,target=/phoenixd/build \
--mount=type=cache,target=/root/.m2 \
--mount=type=cache,target=/phoenixd/.gradle \
--mount=type=cache,target=/root/.gradle \
--mount=type=cache,target=/root/.konan \
./gradlew --build-cache packageLinuxX64 && \
mkdir /phoenixd/build-distributions && \
cp -R /phoenixd/build/distributions/* /phoenixd/build-distributions/ && \
./gradlew --stop

# Copy the build to host machine
FROM ubuntu:18.04 as final
COPY --from=BUILD /phoenixd/build-distributions/* .

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.gradle
build/
out/
.cxx

# this file is local to the dev environment and must not be pushed!
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ Requires `libsqlite-dev` and `libcurl4-gnutls-dev`, both compiled against `glibc
### JVM
```shell
./gradlew distZip
```

## Build with Docker

### Native Linux/WSL

```shell
DOCKER_BUILDKIT=1 docker build --file .docker/linux-release.Dockerfile --output type=local,dest=./out .
```