Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace .netrc with Env Var in Dockerfile #134

Merged
merged 3 commits into from
Dec 14, 2023
Merged

Conversation

jim380
Copy link
Contributor

@jim380 jim380 commented Dec 14, 2023

Overview

This PR attemps to use environment variables in Dockerfile to pass sensitive information like GitHub Personal Access Tokens (PATs) has several advantages over using a .netrc file for the following reasons:

  1. Security: Environment variables are ephemeral and only exist for the duration of the Docker build process. They are not stored in any file that could be accidentally committed to a repository or left around on a filesystem

  2. Flexibility: Environment variables can be easily changed without modifying any files. This is particularly useful in CI/CD environments where you might want to use different PATs for different builds or stages

  3. Portability: Environment variables are a standard feature of all Unix-like operating systems and are supported by all CI/CD systems. On the other hand, the .netrc file is a feature of the netrc library which is not universally supported

  4. Best Practices: It's a common best practice in Docker and 12-factor app methodology to pass configuration to applications using environment variables

Tests

  • test-e2e

@jim380 jim380 requested a review from hacheigriega December 14, 2023 03:22
@@ -213,6 +213,7 @@ cover-html: test-unit-cover

docker-build-e2e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can add a ifdef GITHUB_TOKEN... clause to echo an error message if GITHUB_TOKEN is empty?

@hacheigriega hacheigriega merged commit 02e397c into main Dec 14, 2023
5 of 6 checks passed
@hacheigriega hacheigriega deleted the jay/replace-netrpc branch December 14, 2023 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants