This repository was archived by the owner on Mar 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
[WIP] creation of an x86_64 build environment #2
Open
jopasserat
wants to merge
27
commits into
master
Choose a base branch
from
build_environment
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
9f5d165
enh: create Dockerfile based on Slackware 14.1 for x86_64 builds
jopasserat 4ef0c69
enh: add basic docker commands to README
jopasserat 063edcf
enh: bump care and proot versions (integrate fix loader patch)
jopasserat 3312688
Merge branch 'build_environment' of github.com:proot-me/proot-static-…
jopasserat b49b8de
Cleaner dockerfile based on debian jessie.
romainreuillon 05dc96e
Merge pull request #3 from romainreuillon/build_environment
jopasserat 8807e32
enh: specify jessie as Debian version and clean comments
jopasserat 0a4be15
enh: add target building only libs and support destination folder for…
jopasserat 14c324b
enh: Bake static libs build in Docker
jopasserat 2187a25
enh: rewrite build script to call make in docker as one liner (and co…
jopasserat 1168e38
enh: update README with new command lines
jopasserat d4b02c1
enh: update README with new command lines
jopasserat f33ef11
enh: add possibility to mount other volumes and change destinations +…
jopasserat 7af3e62
Merge branch 'build_environment' of github.com:proot-me/proot-static-…
jopasserat 49daa89
enh: rename Docker to make clearer it only target x86_64 archs
jopasserat 742a84e
enh: lint Dockerfile
jopasserat 80d5e4e
enh: update README
jopasserat fd6e053
enh: generate proot and care licenses upstream
jopasserat 79313c5
enh: switch Dockerfile to multi-stage build
jopasserat 49e9077
enh: try to mount latest version of sources by default
jopasserat 04de69f
fix: missing file and set build dir permissions
jopasserat d4c66a0
fix: simplify user management
jopasserat 4d08c91
enh: split build of environment and tools
jopasserat d75a917
enh: lint build.sh
jopasserat 68dc928
fix: update README to new makefile
jopasserat 21f4b39
enh: inject version files at runtime and use info in build
jopasserat 3f703f1
enh: simplify build script
jopasserat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,12 @@ | ||
| FROM debian:jessie | ||
| MAINTAINER Jonathan Passerat-Palmbach, Imperial College London <j.passerat-palmbach@imperial.ac.uk> | ||
|
|
||
| RUN apt update && apt install -y build-essential gawk autoconf autotools-dev python cmake uthash-dev | ||
|
|
||
| COPY . /opt/build/ | ||
| WORKDIR /opt/build | ||
|
|
||
| RUN make -f GNUmakefile all_libs -j4 | ||
|
|
||
| CMD bash | ||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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,67 @@ | ||
| #!/bin/bash | ||
|
|
||
| ### VARIABLES | ||
|
|
||
| DOCKER_IMAGE='proot/proot-buildenv:latest' | ||
|
|
||
| CONTAINER_USERNAME='dummy' | ||
| CONTAINER_GROUPNAME='dummy' | ||
| GROUP_ID=$(id -g) | ||
| USER_ID=$(id -u) | ||
|
|
||
| # must be an absolute path | ||
| TARGET_DIR=${TARGET_DIR:-"$(pwd)/target"} | ||
|
|
||
| # VOLUMES must be formatted as Docker expects them -> /path_on_host:/mountpoint | ||
| # specify multiple volumes using the ; separator | ||
| VOLUMES=${VOLUMES:-""} | ||
|
|
||
| ### FUNCTIONS | ||
|
|
||
| create_user_cmd() | ||
| { | ||
| if [[ ${USER_ID} -ne 0 ]]; then | ||
| echo \ | ||
| groupadd -f -g ${GROUP_ID} ${CONTAINER_GROUPNAME} '&&' \ | ||
| useradd -u ${USER_ID} -g ${GROUP_ID} ${CONTAINER_USERNAME} '&&' \ | ||
| chown -R ${USER_ID}:${GROUP_ID} /opt/build | ||
| else | ||
| echo echo 'Running build as root...' | ||
| fi | ||
| } | ||
|
|
||
| mount_volumes() { | ||
|
|
||
| if [[ -n ${VOLUMES} ]]; then | ||
| echo -n "-v ${VOLUMES}" | sed -e 's/;/ -v /g' | ||
| fi | ||
|
|
||
| } | ||
|
|
||
| execute_as_cmd() | ||
| { | ||
| if [[ ${USER_ID} -ne 0 ]]; then | ||
| echo \ | ||
| su ${CONTAINER_USERNAME} -c | ||
| else | ||
| echo \ | ||
| eval | ||
| fi | ||
| } | ||
|
|
||
| full_container_cmd() | ||
| { | ||
| echo "'$(create_user_cmd) && $(execute_as_cmd) \"$@\"'" | ||
| } | ||
|
|
||
| ### MAIN | ||
|
|
||
| mkdir -p ${TARGET_DIR} | ||
| eval docker run \ | ||
| --rm=true \ | ||
| -a stdout \ | ||
| -v ${TARGET_DIR}:/opt/build/target $(mount_volumes) \ | ||
| -w /opt/build \ | ||
| ${DOCKER_IMAGE} \ | ||
| /bin/bash -ci $(full_container_cmd $@) | ||
|
|
||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.