mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
Add Dockerfile
This commit is contained in:
+23
@@ -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"]
|
||||
+15
-4
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user