What is Docker image and why is it useful?
Docker images are basically the building blocks of Docker containers. Each of them is a lightweight, standalone, executable software package that includes everything necessary to run an app.
The availability of Docker brings several benefits to developers:
- It simplifies the development process. Developers can easily set up and configure the CAD Exchanger SDK environment using Docker, ensuring consistency across different machines and minimizing compatibility issues.
- This tool provides developers with a portable and reproducible development environment. They can package their CAD Exchanger SDK applications along with all the necessary dependencies and configurations into a Docker image.
- It enables efficient collaboration among developers. With Docker images, they can share their development environment easily, allowing for reducing the chances of environment-specific bugs or discrepancies.
Step-by-step instructions
To get started, you simply need to build the CAD Exchanger SDK Docker image. Once you have the image, you can run it as a container, and you're all set! Let’s see how to do this.
1. Set up Docker on your computer
The first step is to install this tool on your computer and create a DockerHub account (optionally). Head over to the Docker website and look for the version that matches your operating system. Download and install it. To start launching a Docker image, you just need to use a command line program like Terminal or Command Prompt.
2. Unzip the archive folder
As soon as you contact our support team, they will send you an archive. Below, we will look at the instructions using Python as an example. The archive contains 3 important parts:
- ‘Data’ folder with testing file;
- Dockerfile for building a Python testing application image;
- ‘README’ instruction.
README file has all the necessary information and differs slightly, depending on your chosen language: C++, C#, Java, or Python.
3. Add your license file to the folder
To build the image successfully, you should first transfer a license file to the dockerfile folder. Otherwise, you will receive the following error message.
4. Launch the building image
For testing Python example, you need to specify the path to the folder with dockerfile and insert the following line to the console:
$ docker build --build-arg "PYTHON_VERSION=${PYTHON_VERSION}" -f compile-example-python.dockerfile -t compile-example-python .
Please note that you also should choose the desired programming language version: 3.7, 3.8, 3.9, 3.10, or 3.11.
Once the image is built, you can check it by running the following command:
$ docker images
If the image is completely ready, you will see information about it with a unique number.
To make sure that the image works correctly, you can do a sample run of the test model.
Now your Docker image is ready, and you can customize the container environment further to suit your specific requirements!
Summary
Docker images provide a pre-configured and ready-to-use setup for running CAD Exchanger SDK without the hassle of manual installation and configuration.
By utilizing the Docker images, you can easily set up your development or production environment. These images contain all the necessary dependencies and configurations, allowing you to focus on your CAD-related development tasks rather than dealing with setup complexities.