Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ocaml/opam:alpine-3.23-ocaml-4.14 AS build
RUN sudo ln -sf /usr/bin/opam-2.5 /usr/bin/opam && \
opam init --reinit -ni
RUN opam repo add archive git+https://github.com/ocaml/opam-repository-archive --all
RUN opam repo add archive-without-constraint git+https://github.com/tarides/moby-vpnkit-opam-repository-archive#remove-dune-upper-constraint --all

ADD . /home/opam/vpnkit
RUN opam pin add vpnkit /home/opam/vpnkit --kind=path -n
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ build: vpnkit.exe

.PHONY: vpnkit.exe
vpnkit.exe:
opam exec -- dune build --profile release
opam exec -- dune build --profile release @install

.PHONY: ocaml
ocaml:
ocaml -version || opam init --compiler=4.14.0
opam pin add vpnkit . -n
opam switch create ./ ocaml-base-compiler.4.14.3 --no-install
opam repo add archive-without-constraint git+https://github.com/tarides/moby-vpnkit-opam-repository-archive#remove-dune-upper-constraint
opam pin add vpnkit . --kind=path --no-action

.PHONY: depends
depends:
opam install --deps-only -t vpnkit
opam install vpnkit --deps-only --with-test

.PHONY: test
test:
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ Building on Unix (including Mac)
First install `wget`, `opam`, `pkg-config`, and `dylibbundler` using your
package manager of choice.

If you are an existing `opam` user then you can either build against your existing `opam`
package universe, or the custom universe contained in this repo. To use the custom universe,
ensure that you unset your `OPAMROOT` environment variable:
```
unset OPAMROOT
```
If you are an existing `opam` user then you can either build against your
existing `opam` package universe, or the custom universe contained in this
repo.

To set up the OCaml build environment, type:
```
Expand All @@ -40,7 +37,16 @@ To build:
make
```

When the build succeeds the `vpnkit.exe` binary should be available in the current directory.
When the build succeeds the `vpnkit` binary should be available in
`_build/install/default/bin/vpnkit`.

Alternatively you can run it with Dune:

```
dune exec vpnkit
```

which will automatically build and execute `vpnkit`.

Building on Windows
-------------------
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(lang dune 2.0)
(lang dune 3.23)
(name vpnkit)
4 changes: 3 additions & 1 deletion dune-workspace
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
(lang dune 3.19)
(lang dune 3.23)

(repository
(name archive-without-constraint)
(url git+https://github.com/tarides/moby-vpnkit-opam-repository-archive#remove-dune-upper-constraint))

(lock_dir
(repositories upstream overlay archive-without-constraint))

(pkg disabled)
2 changes: 1 addition & 1 deletion vpnkit.opam
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build: [

depends: [
"ocaml" {>="4.08.0"}
"dune" {>= "3.19"}
"dune" {>= "3.23"}
"alcotest" {with-test}
"ounit" {with-test}
"tar" {>= "1.0.1"}
Expand Down
Loading