Entrypoint Command
In this lesson, we will begin working with the ENTRYPOINT instruction. Though ENTRYPOINT functions very similarly to CMD it's behaviors are very different.
ENTRYPOINT allows us to configure a container that will run as an executable. We can override all elements specified using CMD. Using the docker run --entrypoint flag will override the ENTRYPOINT instruction.
Step 1: Setup your environment:
mkdir entrypointcd entrypointStep 2: Clone the image:
git clone https://github.com/nishanthkumarpathi/content-weather-app.git srcStep 3: Create the Dockerfile:
vi DockerfileStep 3: Create an image for the weather-app
Dockerfile contents:
FROM node
LABEL org.label-schema.version=v1.1
ENV NODE_ENV="production"
ENV PORT 3001
RUN mkdir -p /var/node
ADD src/ /var/node/
WORKDIR /var/node
RUN npm install
EXPOSE $PORT
ENTRYPOINT ./bin/wwwStep 4: Build the image:
Step 5: Deploy the weather-app:
Step 6: Inspect weather-app4:
Step 7: Create the weather-app container:
Step 8: Inspect weather-app5:
Step 9: Create the volumes for Prometheus:
Step 10: Create the Prometheus container:
Step 11: Inspect Prometheus:
Prometheus Dockerfile
https://github.com/prometheus/prometheus/blob/master/Dockerfile
Last updated