|
| 1 | +# Copyright 2020 Tetrate |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# |
| 16 | +# Builder image for Envoy Wasm extensions written in Go. |
| 17 | +# |
| 18 | + |
| 19 | +FROM golang:1.15 |
| 20 | + |
| 21 | +ENV TINYGO_VERSION=0.15.0 |
| 22 | + |
| 23 | +RUN wget https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VERSION}/tinygo_${TINYGO_VERSION}_amd64.deb |
| 24 | +RUN dpkg -i tinygo_${TINYGO_VERSION}_amd64.deb && rm tinygo_${TINYGO_VERSION}_amd64.deb |
| 25 | + |
| 26 | +ENV GOCACHE=/source/.gocache |
| 27 | +ENV GOMODCACHE=/source/.gomodcache |
| 28 | +ENV XDG_CACHE_HOME=/source/.cache |
| 29 | + |
| 30 | +ENV TINYGO_SDK_NAME=github.com/tetratelabs/proxy-wasm-go-sdk |
| 31 | +ENV TINYGO_SDK_VERSION=v0.0.1 |
| 32 | +ENV TINYGO_SDK_PATH=${GOMODCACHE}/${TINYGO_SDK_NAME}@${TINYGO_SDK_VERSION} |
| 33 | + |
| 34 | +RUN mkdir -p ${TINYGO_SDK_PATH} && git clone https://${TINYGO_SDK_NAME} -b ${TINYGO_SDK_VERSION} ${TINYGO_SDK_PATH} |
| 35 | + |
| 36 | + |
| 37 | +COPY ./entrypoint.sh /usr/local/getenvoy/extension/builder/entrypoint.sh |
| 38 | +COPY ./tinygo/commands.sh /usr/local/getenvoy/extension/builder/commands.sh |
| 39 | +ENTRYPOINT ["/usr/local/getenvoy/extension/builder/entrypoint.sh"] |
| 40 | +CMD ["--help"] |
0 commit comments