Building, Installing and Setting up the Project
This document provides a step-by-step guide for building, installing, and setting up the docker/buildx project.
Prerequisites
- Go: The project requires Go version 1.16 or later.
- Docker: Docker Desktop or a compatible Docker environment.
Setting up a Development Environment
Clone the Repository:
git clone https://github.com/docker/buildx.git cd buildxInstall Dependencies:
make vendorBuild the Project:
make buildThis will build the
buildxbinary in thebuilddirectory.Run Tests:
make testThis runs all unit, integration, and driver tests.
Installing and Using buildx
Copy the Built Binary:
Copy the
buildxbinary from thebuilddirectory to a location within your PATH.Verify Installation:
buildx versionThis command should output the
buildxversion.
Running buildx
Use the following command to run buildx:
buildx <command> [options]
Refer to the buildx documentation https://docs.docker.com/buildx/ for a detailed list of commands and options.
Contributing to the Project
To contribute to the buildx project, follow the standard GitHub workflow:
- Fork the repository.
- Create a new branch for your changes.
- Make your changes and commit them.
- Push your changes to your fork.
- Create a pull request to the main repository.
Additional Notes
- Updating Dependencies: Use the
make vendorcommand to update dependencies. - Code Formatting: The project uses
gofmtfor code formatting. Runmake fmtto format the code. - Documentation: The project uses
godocfor documentation. Runmake docsto generate the documentation.
Makefile Functions
The following functions are available in the Makefile:
validate-all: Performs all validation checks.authors: Lists the project authors.install: Installs the project.docs: Generates documentation.mod-outdated: Checks for outdated Go modules.generated-files: Lists generated files.test: Runs all tests.test-unit: Runs unit tests.test-driver: Runs driver tests.release: Prepares a release.build: Builds the project.test-integration: Runs integration tests.vendor: Updates dependencies.all: Runs all tasks.shell: Opens an interactive shell.