diff options
author | Darren Rush <[email protected]> | 2018-11-21 17:59:56 -0800 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-12-01 13:40:42 +0100 |
commit | cea0a5977a23a15d2c180c171df0b51bf678645c (patch) | |
tree | e49473de51f4e62e1fb3bee6c88c277d8492f492 | |
parent | b4c90f36776fcd2f8a2ab30b50928442c973afc5 (diff) | |
download | tinygo-cea0a5977a23a15d2c180c171df0b51bf678645c.tar.gz tinygo-cea0a5977a23a15d2c180c171df0b51bf678645c.zip |
docs: enable tinygo/docker to resolve go dependencies
Example for mapping the GOPATH into the tinygo docker image so that go
dependencies installed on the host can be found by the image.
-rw-r--r-- | docs/docker.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/docker.rst b/docs/docker.rst index 5cdeb23f8..94ff8e3d7 100644 --- a/docs/docker.rst +++ b/docs/docker.rst @@ -19,7 +19,14 @@ To compile ``blinky1.hex`` targeting an AVR microcontroller such as the Arduino: docker run --rm -v $(pwd):/src tinygo/tinygo build -o /src/blinky1.hex -size=short -target=arduino examples/blinky1 -Note that for microcontroller development you must flash your hardware devices +For projects that have remote dependencies outside of the standard library and go code within your own project, you will need to map your entire GOPATH into the docker image in order for those dependencies to be found:: + + docker run -v $(PWD):/mysrc -v $GOPATH:/gohost -e "GOPATH=$GOPATH:/gohost" tinygo/tinygo build -o /mysrc/wasmout.wasm -target wasm /mysrc/wasm-main.go + +.. note:: + At this time, tinygo does not resolve dependencies from the /vendor/ folder within your project. + +For microcontroller development you must flash your hardware devices from your host environment, since you cannot run ``tinygo flash`` from inside the docker container. |