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

  1. Clone the Repository:

    git clone https://github.com/docker/buildx.git
              cd buildx
              
  2. Install Dependencies:

    make vendor 
              
  3. Build the Project:

    make build 
              

    This will build the buildx binary in the build directory.

  4. Run Tests:

    make test
              

    This runs all unit, integration, and driver tests.

Installing and Using buildx

  1. Copy the Built Binary:

    Copy the buildx binary from the build directory to a location within your PATH.

  2. Verify Installation:

    buildx version
              

    This command should output the buildx version.

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:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Make your changes and commit them.
  4. Push your changes to your fork.
  5. Create a pull request to the main repository.

Additional Notes

  • Updating Dependencies: Use the make vendor command to update dependencies.
  • Code Formatting: The project uses gofmt for code formatting. Run make fmt to format the code.
  • Documentation: The project uses godoc for documentation. Run make docs to 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.