File tree Expand file tree Collapse file tree 6 files changed +17
-17
lines changed
docs/serving/samples/hello-world Expand file tree Collapse file tree 6 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 1- # Use the official Node.js 12 image.
1+ # Use the official lightweight Node.js 12 image.
22# https://hub.docker.com/_/node
3- FROM node:12
3+ FROM node:12-slim
44
55# Create and change to the app directory.
66WORKDIR /usr/src/app
@@ -14,7 +14,7 @@ COPY package*.json ./
1414RUN npm install --only=production
1515
1616# Copy local code to the container image.
17- COPY . .
17+ COPY . ./
1818
1919# Run the web service on container startup.
2020CMD [ "npm" , "start" ]
Original file line number Diff line number Diff line change @@ -95,9 +95,9 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-nodejs
9595 [ Dockerizing a Node.js web app] ( https://nodejs.org/en/docs/guides/nodejs-docker-webapp/ ) .
9696
9797 ``` Dockerfile
98- # Use the official Node.js 12 image.
98+ # Use the official lightweight Node.js 12 image.
9999 # https://hub.docker.com/_/node
100- FROM node:12
100+ FROM node:12-slim
101101
102102 # Create and change to the app directory.
103103 WORKDIR /usr/src/app
@@ -111,7 +111,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-nodejs
111111 RUN npm install --only=production
112112
113113 # Copy local code to the container image.
114- COPY . .
114+ COPY . ./
115115
116116 # Run the web service on container startup.
117117 CMD [ "npm" , "start" ]
Original file line number Diff line number Diff line change 11# Use the official Python image.
22# https://hub.docker.com/_/python
3- FROM python:3.7
3+ FROM python:3.7-slim
44
55# Copy local code to the container image.
66ENV APP_HOME /app
77WORKDIR $APP_HOME
8- COPY . .
8+ COPY . ./
99
1010# Install production dependencies.
1111RUN pip install Flask gunicorn
Original file line number Diff line number Diff line change @@ -58,14 +58,14 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python
5858 details.
5959
6060 ``` docker
61- # Use the official Python image.
61+ # Use the official lightweight Python image.
6262 # https://hub.docker.com/_/python
63- FROM python:3.7
63+ FROM python:3.7-slim
6464
6565 # Copy local code to the container image.
6666 ENV APP_HOME /app
6767 WORKDIR $APP_HOME
68- COPY . .
68+ COPY . ./
6969
7070 # Install production dependencies.
7171 RUN pip install Flask gunicorn
Original file line number Diff line number Diff line change 1- # Use the official Ruby image.
1+ # Use the official lightweight Ruby image.
22# https://hub.docker.com/_/ruby
3- FROM ruby:2.5
3+ FROM ruby:2.5-slim
44
55# Install production dependencies.
66WORKDIR /usr/src/app
@@ -9,7 +9,7 @@ ENV BUNDLE_FROZEN=true
99RUN bundle install
1010
1111# Copy local code to the container image.
12- COPY . .
12+ COPY . ./
1313
1414# Run the web service on container startup.
1515CMD ["ruby" , "./app.rb" ]
Original file line number Diff line number Diff line change @@ -53,9 +53,9 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
5353 details.
5454
5555 ``` docker
56- # Use the official Ruby image.
56+ # Use the official lightweight Ruby image.
5757 # https://hub.docker.com/_/ruby
58- FROM ruby:2.5
58+ FROM ruby:2.5-slim
5959
6060 # Install production dependencies.
6161 WORKDIR /usr/src/app
@@ -64,7 +64,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
6464 RUN bundle install
6565
6666 # Copy local code to the container image.
67- COPY . .
67+ COPY . ./
6868
6969 # Run the web service on container startup.
7070 CMD ["ruby", "./app.rb"]
You can’t perform that action at this time.
0 commit comments