Этот коммит содержится в:
Johan Brandhorst 2018-10-20 23:56:37 +01:00
родитель 3d644e6ea8
коммит 97caabb8c2
4 изменённых файлов: 53 добавлений и 4 удалений

23
Dockerfile Обычный файл
Просмотреть файл

@ -0,0 +1,23 @@
FROM golang:latest
RUN wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \
echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-7 main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y llvm-7-dev
RUN wget -O- https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
COPY . /go/src/github.com/aykevl/tinygo
RUN go install /go/src/github.com/aykevl/tinygo/
FROM golang:latest
COPY --from=0 /go/bin/tinygo /go/bin/tinygo
RUN wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \
echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-7 main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y llvm-7
ENTRYPOINT ["/go/bin/tinygo"]

Просмотреть файл

@ -66,6 +66,21 @@ Not yet supported:
* introspection (if it ever gets implemented)
* ...
## Installation
See the [installation instructions](https://tinygo.readthedocs.io/en/latest/installation.html).
### Running with Docker
A docker container exists for easy access to the `tinygo` CLI:
```sh
$ docker run --rm -v $(pwd):/src tinygo/tinygo build -o /src/blinky.elf -target arduino /src/examples/blinky
```
Note that you cannot run `tinygo flash` from inside the docker container,
so it is less useful for microcontroller development.
## Supported targets
The following architectures/systems are currently supported:
@ -120,10 +135,6 @@ Non-goals:
crunching.
* Be able to compile every Go program out there.
## Building
See the [installation instructions](https://tinygo.readthedocs.io/en/latest/installation.html).
## Documentation
Documentation is currently maintained on a [dedicated ReadTheDocs

14
docs/docker.rst Обычный файл
Просмотреть файл

@ -0,0 +1,14 @@
.. docker:
.. highlight:: none
Using with Docker
=================
A docker container exists for easy access to the ``tinygo`` CLI.
For example, to compile the blinky example from the root of the repository::
docker run --rm -v $(pwd):/src tinygo/tinygo build -o /src/blinky.elf -target arduino /src/examples/blinky
Note that you cannot run ``tinygo flash`` from inside the docker container,
so it is less useful for microcontroller development.

Просмотреть файл

@ -12,6 +12,7 @@ Contents:
:maxdepth: 2
installation
docker
targets
microcontrollers
faq