-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3220 from Dr-Electron/docker/add-wasp-cli
Add wasp-cli to docker
- Loading branch information
Showing
4 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,6 @@ snapshot | |
tools | ||
wal | ||
wasp | ||
wasp-cli | ||
!tools/wasp-cli | ||
wasp-cluster | ||
waspdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG GOLANG_IMAGE_TAG=1.21-bullseye | ||
|
||
# Build stage | ||
FROM golang:${GOLANG_IMAGE_TAG} AS build | ||
ARG BUILD_LD_FLAGS="--X=github.com/iotaledger/wasp/components/app.Version=v0.0.0-testing" | ||
|
||
LABEL org.label-schema.description="Sandbox Wasp CLI" | ||
LABEL org.label-schema.name="iotaledger/sandbox-wasp-cli" | ||
LABEL org.label-schema.schema-version="1.0" | ||
LABEL org.label-schema.vcs-url="https://github.com/iotaledger/wasp" | ||
|
||
# Ensure ca-certificates are up to date | ||
RUN update-ca-certificates | ||
|
||
# Set the current Working Directory inside the container | ||
RUN mkdir /scratch | ||
WORKDIR /scratch | ||
|
||
# Prepare the folder where we are putting all the files | ||
RUN mkdir /app | ||
|
||
# Make sure that modules only get pulled when the module file has changed | ||
COPY go.mod go.sum ./ | ||
|
||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/root/go/pkg/mod \ | ||
go mod download | ||
|
||
# Project build stage | ||
COPY . . | ||
|
||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/root/go/pkg/mod \ | ||
cd ./tools/wasp-cli && go build -o /app/wasp-cli -a -ldflags=${BUILD_LD_FLAGS} . | ||
|
||
############################ | ||
# Image | ||
############################ | ||
# https://console.cloud.google.com/gcr/images/distroless/global/cc-debian11 | ||
# using distroless cc "nonroot" image, which includes everything in the base image (glibc, libssl and openssl) | ||
FROM gcr.io/distroless/cc-debian11:nonroot | ||
|
||
# Copy the app dir into distroless image | ||
COPY --chown=nonroot:nonroot --from=build /app /app | ||
|
||
WORKDIR /app | ||
USER nonroot | ||
|
||
ENTRYPOINT ["/app/wasp-cli"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Wasp Client tool | ||
|
||
`wasp-cli` is a command line tool for interacting with Wasp and its smart | ||
contracts. Find the documentation for it [here](https://wiki.iota.org/wasp-cli/how-tos/wasp-cli/). | ||
|
||
## Docker | ||
|
||
> [!WARNING] | ||
> The `sandbox-wasp-cli` image is only meant to be used for development use cases like the sandbox. For everything else, download the binaries from the [releases](https://github.com/iotaledger/wasp/releases). |