Fix Dockerfile

From the Snyk app, we will go to the Projects menu where we can expand each integration and have a holistic view of our project. Here we will select the container image under our Amazon ECR repository.

Snyk Projects 02

You will notice a message instructing you to complete one minor configuration item. Let’s address that by clicking the Settings tab.

Snyk Docker Fix 01

Proceed to click on the Configure Dockerfile button.

Snyk Docker Fix 02

Select Bitbucket Cloud as your source.

Snyk Docker Fix 03

Select your repository and click Update Dockerfile.

Snyk Docker Fix 04

Update the default path with the path to our Dockerfile. In this case, the path is /app/goof/Dockerfile or as shown below:

Snyk Docker Fix 05

You will receive a confirmation message stating that the settings have been successfully applied.

Snyk Docker Fix 06

Recommendations for base image upgrade will be provided to you. Here, you will notice the Current image defined in your Dockerfile and a Major upgrade suggestion to reduce the total number of vulnerabilities on your container image.

Snyk Docker Fix 07

For the purpose of this exercise, we will keep things simple and use Bitbucket’s built-in editor to make the change. Let’s navigate to our Dockerfile in our Bitbucket repo. The path will be ./app/goof/Dockerfile. Here we can Edit the file and save our changes.

Bitbucket Edit Dockefile

Let’s update Line 1 as follows:

  • OLD VALUE: node:6-stretch
  • NEW VALUE: node:12.18-stretch

Click Commit.