From c533e06315ef89ac3016510db288209717ef457b Mon Sep 17 00:00:00 2001 From: Sylvia G Date: Sat, 3 Apr 2021 16:05:37 +0300 Subject: [PATCH] add Dockerfile --- .dockerignore | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 22 +++++++++++ README.md | 9 +++++ 3 files changed, 134 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..a7d57db09 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,103 @@ +# Exclude docker related files so that the docker layer cache won't be +# invalidated when editing them because the build context changes. +Dockerfile +.dockerignore + +# Created by https://www.gitignore.io/api/macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# End of https://www.gitignore.io/api/macos + +# Created by https://www.gitignore.io/api/c + +### C ### +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# End of https://www.gitignore.io/api/c + +autom4te.cache +autoscan.log +Makefile +config.log +config.status +configure.scan +config.h +sysroot/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..6fac7970c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:20.04 as build-stage +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update -y +# Install build dependencies +RUN apt-get install -y git +RUN apt-get install -y build-essential +RUN apt-get install -y python python3 +RUN apt-get install -y autoconf automake libtool +RUN apt-get install -y libc++-10-dev libc++abi-10-dev +RUN apt-get install -y lsb-release wget software-properties-common +RUN wget https://apt.llvm.org/llvm.sh +RUN chmod +x llvm.sh +RUN ./llvm.sh 10 # version 10 +# Build libwally-core +COPY . /libwally-core +WORKDIR /libwally-core +RUN git submodule update --init --recursive +ENV CC="clang-10" CXX="clang++-10" +RUN ./tools/autogen.sh +RUN ./configure --disable-clear-tests +RUN make +RUN make check diff --git a/README.md b/README.md index 202b5df45..6b045f0d8 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,15 @@ $ make $ make check ``` +### Building with Docker + +[Install docker](https://docs.docker.com/get-docker/) and run: + +```bash +# Build an Ubuntu image with the library and run tests +$ docker build -t libwally-core . +``` + ### Building on macOS Using homebrew,