Last updated
Last updated
In this lesson, we will explore using build arguments to paramerterize an image build.
Use the --build-arg flag when building an image:
--build-arg [NAME]=[VALUE]
Use the ARG instruction in the Dockerfile:
ARG [NAME]=[DEFAULT_VALUE]
Step 1: Navigate to the args directory:
Step 2: Clone the weather-app:
Step 3: Create the Dockerfile:
Step 4: Create an image for the weather-app
Dockerfile:
Step 5: Build the weather-app image:
Step 6: Inspect the image:
Step 7: Create the weather-app container:
Step 8: Verify that the container is working by executing curl:
In case if you dont find curl in your system, then do the following.