diff --git a/serving/samples/helloworld-rust/Dockerfile b/serving/samples/helloworld-rust/Dockerfile index c3de829fb..84d3c30c1 100644 --- a/serving/samples/helloworld-rust/Dockerfile +++ b/serving/samples/helloworld-rust/Dockerfile @@ -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"] \ No newline at end of file +# Run the web service on container startup. +CMD ["hellorust"] diff --git a/serving/samples/helloworld-rust/README.md b/serving/samples/helloworld-rust/README.md index 0a2030a0e..75faa7471 100644 --- a/serving/samples/helloworld-rust/README.md +++ b/serving/samples/helloworld-rust/README.md @@ -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"] ```