Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

WORKDIR /opt/app

ENV TINYGOROOT="/usr/local/tinygo/"

# Non root user details.
ARG USER_ID=1000
ARG USER_NAME=dev
Expand Down Expand Up @@ -37,6 +39,14 @@ RUN \
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 && \
# Install the golangci-lint linter.
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.63.4 && \
# Install tinygo, go compiler capable of building smaller binaries.
mkdir -p /tmp/tinygo && \
curl -sL https://github.com/tinygo-org/tinygo/releases/download/v0.35.0/tinygo0.35.0.linux-amd64.tar.gz -o /tmp/tinygo/tinygo.tar.gz && \
tar xzf /tmp/tinygo/tinygo.tar.gz --directory /tmp/tinygo && \
mkdir -p /usr/local/tinygo && \
mv /tmp/tinygo/tinygo/* /usr/local/tinygo/ && \
ln -s /usr/local/tinygo/bin/tinygo /usr/local/bin/tinygo && \
rm -Rf /tmp/tinygo && \
# Create the non root user and group.
groupadd --gid ${GROUP_ID} ${GROUP_NAME} && \
useradd --uid ${USER_ID} --gid ${GROUP_ID} --create-home ${USER_NAME} && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ clean:
.PHONY: build
build: clean generate-protobuf
mkdir -p bin
GOOS=wasip1 GOARCH=wasm go build -o bin/sqlc-template.wasm cmd/sqlc-template/main.go
GOOS=wasip1 GOARCH=wasm tinygo build -o bin/sqlc-template.wasm cmd/sqlc-template/main.go
sha256sum bin/sqlc-template.wasm > bin/sqlc-template.sha256

# make container run="<command>" # Run a command from inside the container. Examples: `make container run="make spell-check"`.
Expand Down