Add Dockerfile
Этот коммит содержится в:
родитель
3d644e6ea8
коммит
97caabb8c2
4 изменённых файлов: 53 добавлений и 4 удалений
23
Dockerfile
Обычный файл
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
Обычный файл
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
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче