Building and Starting the Project
Step 1: Setup Your Environment
Make sure that Docker and Docker-py are installed in your environment. You can check if Docker is installed by running:
docker --version
Ensure your Python environment is set up, and docker
python package is installed:
pip install docker
Step 2: Review the Makefile
The project includes a Makefile
that streamlines various execution commands. You can start by looking at the available functions in the Makefile
. Here are some key commands:
test
: Runs all tests.build
: Builds the container images.clean
: Cleans up the generated files and containers.
Step 3: Build the Project
Using the Makefile, the recommended way to build the project is by invoking:
make build
This command will initiate the build process according to the rules specified in the Makefile.
Example:
To specify a build context, you may modify the Dockerfile accordingly and run:
make build SETUPTOOLS_SCM_PRETEND_VERSION_DOCKER=<your_version>
Ensure that the version specified adheres to semantic versioning.
Step 4: Start the Project
After successfully building the project, you can start the project by executing:
make run
If you’ve set up necessary configurations or environments for the Docker container, use docker-compose
if applicable.
Step 5: Testing the Build
To ensure that your build is working correctly, run the test command:
make test
This will execute the tests associated with your project. Refer to the definitions in the Makefile for details on what tests are run by this command.
Step 6: Cleaning Up
When you need to clean up the environment, execute:
make clean
This command will remove unnecessary generated files, containers, and clean your workspace.
Conclusion
Follow these steps to successfully build and start your project using Docker. The Makefile provides a structured workflow to manage your Docker container as well as your Python environment efficiently.
References
Makefile contents.