Removed ENV PORT from all Docker files (#1290)

* Removed ENV PORT from Docker files

* Added back the ENV key
This commit is contained in:
Himanshu Pandey 2019-05-13 08:49:40 -07:00 committed by Knative Prow Robot
parent 40f3fd5725
commit 793f2f3e12
16 changed files with 3 additions and 59 deletions

View File

@ -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"]

View File

@ -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"]
```

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"]

View File

@ -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"]
```

View File

@ -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"]

View File

@ -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"]
```

View File

@ -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/

View File

@ -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/

View File

@ -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"]
```

View File

@ -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"]
```

View File

@ -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"]

View File

@ -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"]
```