Code Monkey home page Code Monkey logo

dockerfiles's Introduction

Dockerfile collection

This is a collection of Dockerfiles (see Wikipedia) for cross compilation to various platforms. Currently, we provide two basic cross compiler environments, each with a few platform variants. All environments are also rebuilt and updated regularly when the source files change.

  • GHC 8.0.1 on Android

    • toktoknet/ghc-android:latest.aarch64: ARM64
    • toktoknet/ghc-android:latest.arm: ARM EABI (32 bit)
    • toktoknet/ghc-android:latest.i686: Intel x86
    • toktoknet/ghc-android:latest.x86_64: AMD64
  • Windows: contains pre-compiled libvpx, opus, libsodium, and check, used for toxcore compilation. It also contains a working wine installation set up to run executables built for the chosen platform.

    • toktoknet/windows:latest.i686-shared: Supporting both shared and statically linked libraries.
    • toktoknet/windows:latest.i686-static: Supporting only fully static builds. Choose this if you want to build statically linked binaries. Some libraries (like Qt) need to be built in a fully static environment to be statically linkable. The -shared variants won't support that use case.
    • toktoknet/windows:latest.x86_64-shared: Win64 shared linking environment.
    • toktoknet/windows:latest.x86_64-static: Win64 static linking environment. See above for considerations.

Furthermore, to support our own use cases, which are building the Tox client qTox and the Haskell Tox implementation hstox, we support images built on the above base environments:

  • GHC 8.0.1 on Android with hstox dependencies pre-built. This allows for much shorter development cycles, as only hstox itself needs to be built. It also allows us to use a different system user for the hstox build, keeping the cabal package database read-only. All 4 platforms are supported. Replace ghc-android with ghc-android-hstox in the above list.
  • Windows with Qt5. To build qTox, we provide an image with all its dependencies (Qt5, ffmpeg, gtk2, openal, qrencode, sqlcipher) in addition to the toxcore dependencies in the base image.

Usage

ghc-android

The ghc-android environments are used as follows (the ARM build is used as an example):

IMAGE=toktoknet/ghc-android:latest.arm
# Pull the image from dockerhub.
docker pull $IMAGE
# Get the "dockrun" script from the image, which automatically mounts the
# current directory to /work in the container.
docker run --rm $IMAGE cat /root/dockrun > dockrun
chmod +x dockrun

Now we can use the dockrun script to build cabal packages in the current directory:

./dockrun target-cabal configure
./dockrun target-cabal build

After this, if your package built successfully, you will have ARM binaries in your dist directory. If you have a non-simple Setup.lhs, you need to first compile it with the host cabal:

./dockrun cabal configure        # Compiles Setup.lhs (or Setup.hs).
./dockrun target-cabal configure # Re-configure with target-cabal.
./dockrun target-cabal build

windows

The Windows environments work in a similar way:

IMAGE=toktoknet/windows:latest.i686-shared
# Pull the image from dockerhub.
docker pull $IMAGE
# Get the "dockrun" script from the image, which automatically mounts the
# current directory to /work in the container.
docker run --rm $IMAGE > dockrun
chmod +x dockrun

Then, build your program or library:

# With autotools:
./dockrun ./configure --host=i686-w64-mingw32.shared # note the "shared"
./dockrun make
# With cmake:
./dockrun i686-w64-mingw32.shared-cmake -B_build -H.
./dockrun make -C_build

dockerfiles's People

Contributors

iphydf avatar robinlinden avatar zoff99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.