The sdflysha/msvc2019 Docker image provides a Windows development environment with tools necessary for C++ development, including Microsoft Visual C++ tools, Git, CMake, Python, and an integrated package manager through vcpkg. The image is based on sdflysha/choco:latest, which has Chocolatey pre-installed, making the installation of additional tools and libraries straightforward.
vcpkg pre-installed, simplifying library management for C++ development on Windows.The image is available as a pre-built container on Docker Hub. You can pull it using:
docker pull sdflysha/msvc2019
To start using this Docker image for C++ development, you can run:
docker run -it sdflysha/msvc2019
This command initiates an interactive session where the Visual Studio build environment is pre-configured through the vcvars64.bat script. You are immediately dropped into a PowerShell session ready for development.
Start by creating a C++ file, e.g., main.cpp.
Use the following sample code:
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
Compile the program using cl.exe, the Microsoft C/C++ compiler:
cl.exe main.cpp
Run the compiled executable:
.\main.exe
If you prefer to build the image from source, follow these steps:
Clone the source repository:
git clone https://github.com/sdcb/dockerfiles.git
Navigate to the msvc/msvc2019 directory:
cd dockerfiles/src/msvc/msvc2019
Build the Docker image:
docker build -t your-custom-tag .
Here’s a brief overview of what each instruction in the Dockerfile does:
sdflysha/choco:latest which includes Chocolatey.git, cmake, python, and visualstudio2019-workload-vctools.vcpkg from its official repository, bootstraps it, adds it to the system PATH, and installs/removes zlib as a demonstration.Contributions to this Docker image or its documentation are welcome. Submit pull requests or issues to the GitHub repository.
This Docker image is distributed under the MIT License, the details of which can be found in the GitHub repository.
For more information regarding the tools used in this image, refer to their respective websites:
Thank you for choosing sdflysha/msvc2019 for your development needs.
Content type
Image
Digest
sha256:a56f3557f…
Size
6.1 GB
Last updated
over 1 year ago
docker pull sdflysha/msvc2019