From 793f2f3e12aa27262cc57b19d35e832b8540d383 Mon Sep 17 00:00:00 2001 From: Himanshu Pandey Date: Mon, 13 May 2019 08:49:40 -0700 Subject: [PATCH] Removed ENV PORT from all Docker files (#1290) * Removed ENV PORT from Docker files * Added back the ENV key --- community/samples/serving/helloworld-clojure/Dockerfile | 4 ---- community/samples/serving/helloworld-clojure/README.md | 4 ---- community/samples/serving/helloworld-dart/Dockerfile | 3 --- community/samples/serving/helloworld-dart/README.md | 4 ---- community/samples/serving/helloworld-elixir/Dockerfile | 2 +- community/samples/serving/helloworld-elixir/README.md | 3 +-- community/samples/serving/helloworld-haskell/Dockerfile | 4 ---- community/samples/serving/helloworld-haskell/README.md | 6 +----- community/samples/serving/helloworld-rust/Dockerfile | 4 ---- community/samples/serving/helloworld-rust/README.md | 4 ---- community/samples/serving/helloworld-vertx/Dockerfile | 4 ---- community/samples/serving/helloworld-vertx/README.md | 4 ---- docs/install/Knative-with-Gloo.md | 4 ---- .../samples/hello-world/helloworld-java-spark/README.md | 4 ---- docs/serving/samples/secrets-go/Dockerfile | 4 ---- docs/serving/samples/secrets-go/README.md | 4 ---- 16 files changed, 3 insertions(+), 59 deletions(-) diff --git a/community/samples/serving/helloworld-clojure/Dockerfile b/community/samples/serving/helloworld-clojure/Dockerfile index ac1d66d5d..c7881b1ca 100644 --- a/community/samples/serving/helloworld-clojure/Dockerfile +++ b/community/samples/serving/helloworld-clojure/Dockerfile @@ -13,9 +13,5 @@ COPY . . # Build an uberjar release artifact. RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" app-standalone.jar -# Service must listen to $PORT environment variable. -# This default value facilitates local development. -ENV PORT 8080 - # Run the web service on container startup. CMD ["java", "-jar", "app-standalone.jar"] diff --git a/community/samples/serving/helloworld-clojure/README.md b/community/samples/serving/helloworld-clojure/README.md index 4b48aa821..61c1c79da 100644 --- a/community/samples/serving/helloworld-clojure/README.md +++ b/community/samples/serving/helloworld-clojure/README.md @@ -73,10 +73,6 @@ recreate the source files from this folder. # Build an uberjar release artifact. RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" app-standalone.jar - # Service must listen to $PORT environment variable. - # This default value facilitates local development. - ENV PORT 8080 - # Run the web service on container startup. CMD ["java", "-jar", "app-standalone.jar"] ``` diff --git a/community/samples/serving/helloworld-dart/Dockerfile b/community/samples/serving/helloworld-dart/Dockerfile index 4d00aa6fb..87d64b102 100644 --- a/community/samples/serving/helloworld-dart/Dockerfile +++ b/community/samples/serving/helloworld-dart/Dockerfile @@ -2,6 +2,3 @@ # https://hub.docker.com/r/google/dart-runtime/ FROM google/dart-runtime -# Service must listen to $PORT environment variable. -# This default value facilitates local development. -ENV PORT 8080 diff --git a/community/samples/serving/helloworld-dart/README.md b/community/samples/serving/helloworld-dart/README.md index 958c2a7a8..f216580e1 100644 --- a/community/samples/serving/helloworld-dart/README.md +++ b/community/samples/serving/helloworld-dart/README.md @@ -74,10 +74,6 @@ be created using the following instructions. # Use Google's official Dart image. # https://hub.docker.com/r/google/dart-runtime/ FROM google/dart-runtime - - # Service must listen to $PORT environment variable. - # This default value facilitates local development. - ENV PORT 8080 ``` 5. Create a new file, `service.yaml` and copy the following service definition diff --git a/community/samples/serving/helloworld-elixir/Dockerfile b/community/samples/serving/helloworld-elixir/Dockerfile index 586c8f6b7..dd8c663b1 100644 --- a/community/samples/serving/helloworld-elixir/Dockerfile +++ b/community/samples/serving/helloworld-elixir/Dockerfile @@ -31,7 +31,7 @@ RUN chown appuser /opt/app/var USER appuser -ENV PORT=8080 MIX_ENV=prod REPLACE_OS_VARS=true +ENV MIX_ENV=prod REPLACE_OS_VARS=true WORKDIR /opt/app COPY --from=0 /opt/release . ENV RUNNER_LOG_DIR /var/log diff --git a/community/samples/serving/helloworld-elixir/README.md b/community/samples/serving/helloworld-elixir/README.md index ea2c84a35..4a45d20c0 100644 --- a/community/samples/serving/helloworld-elixir/README.md +++ b/community/samples/serving/helloworld-elixir/README.md @@ -79,8 +79,7 @@ When asked, if you want to `Fetch and install dependencies? [Yn]` select `y` # Run everything else as 'appuser' USER appuser - # Document that the service listens on port 8080. - ENV PORT=8080 MIX_ENV=prod REPLACE_OS_VARS=true + ENV MIX_ENV=prod REPLACE_OS_VARS=true WORKDIR /opt/app COPY --from=0 /opt/release . ENV RUNNER_LOG_DIR /var/log diff --git a/community/samples/serving/helloworld-haskell/Dockerfile b/community/samples/serving/helloworld-haskell/Dockerfile index ec479234c..f4377fb46 100644 --- a/community/samples/serving/helloworld-haskell/Dockerfile +++ b/community/samples/serving/helloworld-haskell/Dockerfile @@ -18,9 +18,5 @@ FROM fpco/haskell-scratch:integer-gmp WORKDIR /root/ COPY --from=builder /root/.local/bin/helloworld-haskell-exe . -# Service must listen to $PORT environment variable. -# This default value facilitates local development. -ENV PORT 8080 - # Run the web service on container startup. CMD ["./helloworld-haskell-exe"] diff --git a/community/samples/serving/helloworld-haskell/README.md b/community/samples/serving/helloworld-haskell/README.md index 7b682be51..dbf75e3d1 100644 --- a/community/samples/serving/helloworld-haskell/README.md +++ b/community/samples/serving/helloworld-haskell/README.md @@ -98,11 +98,7 @@ recreate the source files from this folder. # Copy the "helloworld-haskell-exe" executable from the builder stage to the production image. WORKDIR /root/ COPY --from=builder /root/.local/bin/helloworld-haskell-exe . - - # Service must listen to $PORT environment variable. - # This default value facilitates local development. - ENV PORT 8080 - + # Run the web service on container startup. CMD ["./helloworld-haskell-exe"] ``` diff --git a/community/samples/serving/helloworld-rust/Dockerfile b/community/samples/serving/helloworld-rust/Dockerfile index 10073fc6c..258d6983f 100644 --- a/community/samples/serving/helloworld-rust/Dockerfile +++ b/community/samples/serving/helloworld-rust/Dockerfile @@ -9,9 +9,5 @@ COPY . . # Install production dependencies and build a release artifact. RUN cargo install -# Service must listen to $PORT environment variable. -# This default value facilitates local development. -ENV PORT 8080 - # Run the web service on container startup. CMD ["hellorust"] diff --git a/community/samples/serving/helloworld-rust/README.md b/community/samples/serving/helloworld-rust/README.md index b5df71120..5b940e6ef 100644 --- a/community/samples/serving/helloworld-rust/README.md +++ b/community/samples/serving/helloworld-rust/README.md @@ -97,10 +97,6 @@ recreate the source files from this folder. # Install production dependencies and build a release artifact. RUN cargo install - # Service must listen to $PORT environment variable. - # This default value facilitates local development. - ENV PORT 8080 - # Run the web service on container startup. CMD ["hellorust"] ``` diff --git a/community/samples/serving/helloworld-vertx/Dockerfile b/community/samples/serving/helloworld-vertx/Dockerfile index 0fe5bec6c..2080225e7 100644 --- a/community/samples/serving/helloworld-vertx/Dockerfile +++ b/community/samples/serving/helloworld-vertx/Dockerfile @@ -2,10 +2,6 @@ # https://hub.docker.com/r/fabric8/s2i-java FROM fabric8/s2i-java:2.0 -# Service must listen to $PORT environment variable. -# This default value facilitates local development. -ENV PORT 8080 - # Copy the JAR file to the deployment directory. ENV JAVA_APP_DIR=/deployments COPY target/helloworld-1.0.0-SNAPSHOT.jar /deployments/ diff --git a/community/samples/serving/helloworld-vertx/README.md b/community/samples/serving/helloworld-vertx/README.md index d022bf598..95d69f912 100644 --- a/community/samples/serving/helloworld-vertx/README.md +++ b/community/samples/serving/helloworld-vertx/README.md @@ -146,10 +146,6 @@ To create and configure the source files in the root of your working directory: # https://hub.docker.com/r/fabric8/s2i-java FROM fabric8/s2i-java:2.0 - # Service must listen to $PORT environment variable. - # This default value facilitates local development. - ENV PORT 8080 - # Copy the JAR file to the deployment directory. ENV JAVA_APP_DIR=/deployments COPY target/helloworld-1.0.0-SNAPSHOT.jar /deployments/ diff --git a/docs/install/Knative-with-Gloo.md b/docs/install/Knative-with-Gloo.md index e046bfa2d..67dddceed 100644 --- a/docs/install/Knative-with-Gloo.md +++ b/docs/install/Knative-with-Gloo.md @@ -167,10 +167,6 @@ RUN apk add --no-cache ca-certificates # Copy the binary to the production image from the builder stage. COPY --from=builder /go/src/github.com/knative/docs/helloworld/helloworld /helloworld -# Service must listen to $PORT environment variable. -# This default value facilitates local development. -ENV PORT 8080 - # Run the web service on container startup. CMD ["/helloworld"] ``` diff --git a/docs/serving/samples/hello-world/helloworld-java-spark/README.md b/docs/serving/samples/hello-world/helloworld-java-spark/README.md index 8681c3f1e..20afda424 100644 --- a/docs/serving/samples/hello-world/helloworld-java-spark/README.md +++ b/docs/serving/samples/hello-world/helloworld-java-spark/README.md @@ -66,10 +66,6 @@ recreate the source files from this folder. # Copy the jar to the production image from the builder stage. COPY --from=builder /app/target/helloworld-0.0.1-SNAPSHOT-jar-with-dependencies.jar /helloworld.jar - # Service must listen to $PORT environment variable. - # This default value facilitates local development. - ENV PORT 8080 - # Run the web service on container startup. CMD ["java","-Dserver.port=${PORT}","-jar","/helloworld.jar"] ``` diff --git a/docs/serving/samples/secrets-go/Dockerfile b/docs/serving/samples/secrets-go/Dockerfile index 9b73011f8..87f50a513 100644 --- a/docs/serving/samples/secrets-go/Dockerfile +++ b/docs/serving/samples/secrets-go/Dockerfile @@ -27,9 +27,5 @@ RUN apk add --no-cache ca-certificates # Copy the binary to the production image from the builder stage. COPY --from=builder /go/src/github.com/knative/docs/hellosecrets/hellosecrets /hellosecrets -# Service must listen to $PORT environment variable. -# This default value facilitates local development. -ENV PORT 8080 - # Run the web service on container startup. CMD ["/hellosecrets"] diff --git a/docs/serving/samples/secrets-go/README.md b/docs/serving/samples/secrets-go/README.md index 0ee8d6b5c..d21ff3b54 100644 --- a/docs/serving/samples/secrets-go/README.md +++ b/docs/serving/samples/secrets-go/README.md @@ -113,10 +113,6 @@ recreate the source files from this folder. # Copy the binary to the production image from the builder stage. COPY --from=builder /go/src/github.com/knative/docs/hellosecrets/hellosecrets /hellosecrets - # Service must listen to $PORT environment variable. - # This default value facilitates local development. - ENV PORT 8080 - # Run the web service on container startup. CMD ["/hellosecrets"] ```