Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dunglas/docker-private-composer-packages
Example: Securely Access Private Composer Packages
https://github.com/dunglas/docker-private-composer-packages
composer docker docker-compose
Last synced: 14 days ago
JSON representation
Example: Securely Access Private Composer Packages
- Host: GitHub
- URL: https://github.com/dunglas/docker-private-composer-packages
- Owner: dunglas
- Created: 2022-08-09T09:11:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-09T21:18:45.000Z (about 2 years ago)
- Last Synced: 2024-10-04T16:25:36.910Z (about 1 month ago)
- Topics: composer, docker, docker-compose
- Language: Dockerfile
- Homepage:
- Size: 10.7 KB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example: Securely Access Private Composer Packages
Following [my article "Securely Access Private Git Repositories and Composer Packages in Docker Builds"](https://dunglas.fr/2022/08/securely-access-private-git-repositories-and-composer-packages-in-docker-builds/) and [this discussion on Twitter](https://twitter.com/benjamindavies/status/1556900014965899269), here is an example of how to use an `auth.json` file mounted as a Docker secret file to download private Composer packages.
First, create a local `auth.json` file containing a GitHub Personal Access Token and update `composer.json` to reference a private package:
```json
{
"github-oauth": {
"github.com": "ghp_"
}
}
```Build with Docker Compose: `docker compose build`
Build with Docker: `docker build --secret id=composer_auth,src=auth.json .`