Skip to content

Commit

Permalink
Update clang / boost version in Dockerfile (#972)
Browse files Browse the repository at this point in the history
* Create docker.yml

* update docker image: clang-9 boost 1.70 swift-protobuf 1.9.0

* Lint Dockerfile

* cleanup
  • Loading branch information
hewigovens authored May 31, 2020
1 parent abe125b commit fc01315
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 93 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker CI

on:
push:
branches: [ master ]
paths:
- Dockerfile
- tools/install-dependencies
pull_request:
branches: [ master ]
paths:
- Dockerfile
- tools/install-dependencies

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint Dockerfile
run: |
curl -L https://github.com/hadolint/hadolint/releases/download/v1.17.6/hadolint-Linux-x86_64 -o hadolint && chmod +x hadolint
./hadolint Dockerfile
- name: Build Dockerfile
uses: docker/[email protected]
with:
repository: trustwallet/wallet-core
tags: latest
push: false
3 changes: 3 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignored:
- DL3008
- DL3015
52 changes: 52 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM ubuntu:18.04

# Install some basics
RUN apt-get update \
&& apt-get install -y \
wget \
curl \
git \
vim \
unzip \
xz-utils \
software-properties-common \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Add latest cmake/boost
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - \
&& apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' \
&& apt-add-repository -y ppa:mhier/libboost-latest

# Install required packages for dev
RUN apt-get update \
&& apt-get install -y \
build-essential \
libtool autoconf pkg-config \
ninja-build \
ruby-full \
clang-9 \
llvm-9 \
libc++-dev libc++abi-dev \
cmake \
libboost1.70-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

ENV CC=/usr/bin/clang-9
ENV CXX=/usr/bin/clang++-9

# ↑ Setup build environment (could be a base image)
# ↓ Build and compile wallet core

RUN git clone https://github.com/trustwallet/wallet-core.git
WORKDIR /wallet-core

# Install dependencies
RUN tools/install-dependencies

# Build: generate, cmake, and make
RUN tools/generate-files \
&& cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug \
&& make -Cbuild -j12

CMD ["/bin/bash"]
85 changes: 0 additions & 85 deletions docker/wallet-core/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions tools/docker-build

This file was deleted.

7 changes: 5 additions & 2 deletions tools/install-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ tar xzf release-$GTEST_VERSION.tar.gz
# Build gtest
cd googletest-release-$GTEST_VERSION
cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -H.
make
make -j4
make install
make clean

# Download Check
export CHECK_VERSION=0.12.0
Expand All @@ -45,6 +46,7 @@ cd check-$CHECK_VERSION
./configure --prefix="$PREFIX"
make -j4
make install
make clean

# Download Nlohmann JSON
export JSON_VERSION=3.5.0
Expand Down Expand Up @@ -77,7 +79,7 @@ make clean

if [[ -x "$(command -v swift)" && `uname` == "Darwin" ]]; then
# Download Swift Protobuf sources
export SWIFT_PROTOBUF_VERSION=1.7.0
export SWIFT_PROTOBUF_VERSION=1.9.0
SWIFT_PROTOBUF_DIR="$ROOT/build/local/src/swift-protobuf"
mkdir -p "$SWIFT_PROTOBUF_DIR"
cd "$SWIFT_PROTOBUF_DIR"
Expand All @@ -98,5 +100,6 @@ cd "$ROOT/protobuf-plugin"
cmake -H. -Bbuild -DCMAKE_INSTALL_PREFIX=$PREFIX
make -Cbuild -j12
make -Cbuild install
rm -rf build

cd "$ROOT"

0 comments on commit fc01315

Please sign in to comment.