mirror of https://github.com/knative/docs.git
serving/samples/helloworld-rust: simplify and standardize Dockerfile (#502)
This commit is contained in:
parent
26a7f1e9dc
commit
5036ec1c9c
|
@ -1,10 +1,17 @@
|
|||
# Use the official Rust image.
|
||||
# https://hub.docker.com/_/rust
|
||||
FROM rust:1.27.0
|
||||
|
||||
# Copy local code to the container image.
|
||||
WORKDIR /usr/src/app
|
||||
COPY . .
|
||||
|
||||
# Install production dependencies and build a release artifact.
|
||||
RUN cargo install
|
||||
|
||||
EXPOSE 8080
|
||||
# Configure and document the service HTTP port.
|
||||
ENV PORT 8080
|
||||
EXPOSE $PORT
|
||||
|
||||
CMD ["hellorust"]
|
||||
# Run the web service on container startup.
|
||||
CMD ["hellorust"]
|
||||
|
|
|
@ -88,15 +88,22 @@ following instructions recreate the source files from this folder.
|
|||
block below into it.
|
||||
|
||||
```docker
|
||||
# Use the official Rust image.
|
||||
# https://hub.docker.com/_/rust
|
||||
FROM rust:1.27.0
|
||||
|
||||
# Copy local code to the container image.
|
||||
WORKDIR /usr/src/app
|
||||
COPY . .
|
||||
|
||||
# Install production dependencies and build a release artifact.
|
||||
RUN cargo install
|
||||
|
||||
EXPOSE 8080
|
||||
# Configure and document the service HTTP port.
|
||||
ENV PORT 8080
|
||||
EXPOSE $PORT
|
||||
|
||||
# Run the web service on container startup.
|
||||
CMD ["hellorust"]
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue