forked from knative/docs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked shell hello world example (knative#2832)
* Change event type in Sequence with Broker example (knative#2897) (knative#2916) If the type of the event isn't changed by the last step in the sequence the event will be resent to the Trigger that targets the sequence creating an unwanted loop. Fixes knative#2851 Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com> * Reworked shell hello world example * Reworked example to be a "true" shell example that is considerable different than the helloworld-go example * Added examples for kn usage (Fixed according to review comments) Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
- Loading branch information
1 parent
98e4c18
commit 063452e
Showing
8 changed files
with
235 additions
and
279 deletions.
There are no files selected for viewing
35 changes: 8 additions & 27 deletions
35
docs/serving/samples/hello-world/helloworld-shell/Dockerfile
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 |
---|---|---|
@@ -1,32 +1,13 @@ | ||
# Use the official Golang image to create a build artifact. | ||
# This is based on Debian and sets the GOPATH to /go. | ||
# https://hub.docker.com/_/golang | ||
FROM golang:1.13 as builder | ||
|
||
# Create and change to the app directory. | ||
WORKDIR /app | ||
|
||
# Retrieve application dependencies using go modules. | ||
# Allows container builds to reuse downloaded dependencies. | ||
COPY go.* ./ | ||
RUN go mod download | ||
|
||
# Copy local code to the container image. | ||
COPY invoke.go ./ | ||
|
||
# Build the binary. | ||
# -mod=readonly ensures immutable go.mod and go.sum in container builds. | ||
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server | ||
|
||
# Use the official Alpine image for a lean production container. | ||
# https://hub.docker.com/_/alpine | ||
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds | ||
FROM alpine:3 | ||
RUN apk add --no-cache ca-certificates | ||
|
||
# Copy the binary to the production image from the builder stage. | ||
COPY --from=builder /app/server /server | ||
COPY script.sh ./ | ||
# Update & install netcat (nc) | ||
RUN apk update \ | ||
&& apk add netcat-openbsd | ||
|
||
# Copy over the service script | ||
COPY script.sh / | ||
|
||
# Run the web service on container startup. | ||
CMD ["/server"] | ||
# Start up the webserver | ||
CMD [ "/bin/sh", "/script.sh" ] |
204 changes: 0 additions & 204 deletions
204
docs/serving/samples/hello-world/helloworld-shell/README.md
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.