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

feat(linux): Dockerfile for linux builder #7133

Merged
merged 1 commit into from
Aug 29, 2022
Merged

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Aug 26, 2022

  • add Dockerfile in linux/Dockerfile, referencing linux/debian/control
  • add docs in docs/build/linux-ubuntu.md

Fixes: #7102

@keymanapp-test-bot skip

- add Dockerfile in linux/Dockerfile, referencing linux/debian/control
- add docs in docs/build/linux-ubuntu.md

Fixes: #7102
@srl295 srl295 self-assigned this Aug 26, 2022
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Aug 26, 2022
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Aug 26, 2022

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-missing User tests have not yet been defined for the PR label Aug 26, 2022
@srl295
Copy link
Member Author

srl295 commented Aug 26, 2022

I used the keymanapp/ org found at https://hub.docker.com/u/keymanapp but there's no automation to push this build there.

I use this image a lot. It ought to be able to build all of keyman, But I've only tested it with core.

@srl295 srl295 modified the milestones: A16S10, A16S9 Aug 26, 2022
Copy link
Contributor

@ermshiperete ermshiperete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

cd ../core
# keep linux build artifacts separate
mkdir -p build/linux
docker run -it --rm -v $(pwd)/..:/home/build -v $(pwd)/build/linux:/home/build/core/build keyman-linux-builder:latest bash -c 'cd core; bash build.sh -d'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both -vs? I'd think the latter is included in the former.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, by default it builds into build/arch which would stomp on your local build. This creates a build/linux which is its own build subdirectory.

@srl295 srl295 merged commit a6bd34b into master Aug 29, 2022
@srl295 srl295 deleted the feat/linux/7102-dockerfile branch August 29, 2022 17:21
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 16.0.53-alpha

@mcdurdin
Copy link
Member

Just thinking about this -- I think the Dockerfile should be in /resources/devbox/linux, as ideally we will have multiple Docker images for different platform builds -- one for each platform (although Windows will probably be a non-starter for a while due to Delphi). And this is about build environment rather than something specific to Keyman.

Currently discussing whether or not we can do a Docker image for macOS builds as well. We may use this for future macOS build agents.

@srl295
Copy link
Member Author

srl295 commented Aug 29, 2022

@mcdurdin OK, want a new PR to move it there?

@mcdurdin
Copy link
Member

@mcdurdin OK, want a new PR to move it there?

Oh yes please 😁

@srl295
Copy link
Member Author

srl295 commented Aug 29, 2022

@mcdurdin OK, want a new PR to move it there?

Oh yes please 😁

A wrinke here is that the Dockerfile depends on linux/debian/control - it actually is using the debian control file to pull in the deps. Could have a script in devbox that copies over linux/debian/control into a gitignored location?

@mcdurdin
Copy link
Member

It's not possible to ADD ../../../linux/debian/control /tmp/control?

@srl295
Copy link
Member Author

srl295 commented Aug 29, 2022

It's not possible to ADD ../../../linux/debian/control /tmp/control?

No, it's not possible to ADD outside of the docker context. You could start from up three levels, but then it would send the entre repo as context.

@srl295
Copy link
Member Author

srl295 commented Aug 29, 2022

conversely, could a script in devbox do docker build ../../../linux ?

@mcdurdin
Copy link
Member

Yeah I guess so? Then we'll eventually end up with a Dockerfile in each of the primary top-level platform folders -- android/Dockerfile, developer/Dockerfile, ios/Dockerfile, linux/Dockerfile, mac/Dockerfile, web/Dockerfile, windows/Dockerfile?

Alternatively, just three: linux/Dockerfile, windows/Dockerfile, mac/Dockerfile, which contain all the toolchains needed for building any product that can be built on that platform. (Gosh what a wonderful world it would be if macOS would (legally) run in a VM on non-mac hardware...)

Windows is complicated because Delphi. macOS will be a massive image because XCode. So not sure this is yet ideal but step-by-step we improve our build environments I hope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(build): add a Dockerfile for linux builds
4 participants