-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support exporting Windows Dockerfiles
- Loading branch information
Showing
8 changed files
with
192 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 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,49 @@ | ||
; This script builds OBuilder itself using a snapshot of the | ||
; ocaml/opam:window-mingw-20H2-ocaml-4.12 base image. | ||
; | ||
; Run it from the top-level of the OBuilder source tree, e.g. | ||
; | ||
; dune exec -- obuilder build --docker-backend=../var -f example.windows.spec . | ||
; | ||
; The result can then be found in ../var/HASH/rootfs/ (where HASH is | ||
; displayed at the end of the build). | ||
|
||
((build dev | ||
((from ocaml/opam@sha256:875f8962b438f16fd20076730d8db3f328155ab2ce9499b375bda5c4d9da9788) | ||
(workdir /project) | ||
(env OPAM_HASH "96d0b8dbb64a291108c8bccb5cdbb1936f853207") ; Fix the version of opam-repository we want | ||
(shell C:/cygwin64/bin/bash.exe --login -c) | ||
(run | ||
(network "Default Switch") | ||
(shell | ||
"cd /home/opam/opam-repository \ | ||
&& (git cat-file -e $OPAM_HASH || git fetch origin master) \ | ||
&& git reset -q --hard $OPAM_HASH \ | ||
&& git log --no-decorate -n1 --oneline \ | ||
&& opam update -u")) | ||
(shell C:/Windows/System32/cmd.exe /S /C) | ||
; Copy just the opam file first (helps caching) | ||
(copy (src obuilder-spec.opam obuilder.opam) (dst ./)) | ||
(run (shell "ocaml-env exec --64 -- opam pin add -yn .")) | ||
; Install OS package dependencies | ||
(run | ||
(cache (opam-archives (target /opam/.opam/download-cache))) | ||
(shell "ocaml-env exec --64 -- opam depext -yu obuilder")) | ||
; Install OCaml dependencies | ||
(run | ||
(cache (opam-archives (target /opam/.opam/download-cache))) | ||
(shell "ocaml-env exec --64 -- opam install --deps-only -t obuilder")) | ||
(copy ; Copy the rest of the source code | ||
(src .) | ||
(dst /project/) | ||
(exclude .git _build _opam)) | ||
(run (shell "ocaml-env exec --64 -- dune build @install @runtest")))) ; Build and test | ||
; Now generate a small runtime image with just the resulting binary: | ||
(from mcr.microsoft.com/windows/nanoserver:20H2) | ||
(copy (from (build dev)) | ||
(src /cygwin64/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libsqlite3-0.dll) | ||
(dst /obuilder/)) | ||
(copy (from (build dev)) | ||
(src /project/_build/default/main.exe) | ||
(dst /obuilder/obuilder.exe)) | ||
(run (shell "/obuilder/obuilder.exe --help"))) |
This file contains 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 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 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 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 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 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