Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Latest commit

 

History

History
28 lines (23 loc) · 910 Bytes

Challenge3.md

File metadata and controls

28 lines (23 loc) · 910 Bytes

Moving the customizations from postCreateCommand to the local Dockerfile

Once we have validated the code in the bash script, the next step is to move the changes to the local Dockerfile. This brings us back to the tip from solution1:

(from solution 1) From the Field

We never just have an image pointer in devcontainer.json like below:

{
    "image": "python:3.9"
}

Even if we are just using the base image, we have a Dockerfile with a FROM and point to the image. Below is a simplified equivelant to the above, using a Dockerfile:

{
	"build": {
		"dockerfile": "Dockerfile"
	}
}
FROM python:3.9

This refactor illustrates why that tip is in place. We already have a Dockerfile in our solution where we can move our changes.

Challenge

Move the logic that installs the dependencies for the application from the bash script file to the local Dockerfile.