hashicorp / terraform-docs-agents

Content for Terraform's agents documentation.
terraform-docs-agents.vercel.app
Mozilla Public License 2.0
7 stars 15 forks source link

TFE custom agent image: Update example Docker image to work #39

Closed USA-RedDragon closed 1 year ago

USA-RedDragon commented 1 year ago

What

This change updates the TFE custom agent image example in the documentation to bring it to parity with the TFC/TFE custom worker image documentation example here: https://developer.hashicorp.com/terraform/enterprise/install/interactive/installer#ubuntu

Why

With the current documentation, users will face the following error:

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/s/sudo/sudo_1.8.31-1ubuntu1.2_amd64.deb  404  Not Found [IP: 185.125.190.36 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Merge Checklist

If items do not apply to your changes, add (N/A) and mark them as complete.

Pull Request

Content

Reviews

vercel[bot] commented 1 year ago

@USA-RedDragon is attempting to deploy a commit to the HashiCorp Team on Vercel.

A member of the Team first needs to authorize it.

ryanuber commented 1 year ago

Hey @USA-RedDragon, thanks so much for tackling this! I tried our example and indeed, I got the same error you mentioned, so this definitely needs to be fixed! I was able to fix it by simply changing the command to be apt-get update && apt-get install sudo, which is a bit easier on the eyes and seems to address the situation. What do you think about using that command instead?

USA-RedDragon commented 1 year ago

I have no true qualms with changing it to the shorter command, but to explain my reasoning:

It would be nice that the example follows and normalizes the Dockerfile best practices for installing packages.

[...] when you clean up the apt cache by removing /var/lib/apt/lists it reduces the image size, since the apt cache isn’t stored in a layer

Depending on how long time-wise the drift is between base image and current package versions after an update, the cache could be noticable on the final image