Sign inSign up

sdflysha/msvc2017

By sdflysha

•Updated over 1 year ago

Image
0

1.8K

sdflysha/msvc2017 repository overview

⁠sdflysha/msvc2017 Docker Image

The sdflysha/msvc2017 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.

⁠Features

  • Pre-installed Development Tools: Includes Git, CMake, Python, and Visual Studio 2017 Build Tools with the C++ workload.
  • Package Management with vcpkg: Comes with vcpkg pre-installed, simplifying library management for C++ development on Windows.
  • Ready-to-Use Build Environment: The container is set up to directly use the Visual Studio build tools' command-line environment.

⁠Installation

The image is available as a pre-built container on Docker Hub. You can pull it using:

docker pull sdflysha/msvc2017

⁠Usage

To start using this Docker image for C++ development, you can run:

docker run -it sdflysha/msvc2017

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.

⁠Example: Compiling a C++ Program
  1. Start by creating a C++ file, e.g., main.cpp.

  2. Use the following sample code:

    #include <iostream>
    int main() {
        std::cout << "Hello, World!" << std::endl;
        return 0;
    }
    
  3. Compile the program using cl.exe, the Microsoft C/C++ compiler:

    cl.exe main.cpp
    
  4. Run the compiled executable:

    .\main.exe
    

⁠Building from Source

If you prefer to build the image from source, follow these steps:

  1. Clone the source repository:

    git clone https://github.com/sdcb/dockerfiles.git
    
  2. Navigate to the msvc/msvc2017 directory:

    cd dockerfiles/src/msvc/msvc2017
    
  3. Build the Docker image:

    docker build -t your-custom-tag .
    

⁠Dockerfile Details

Here’s a brief overview of what each instruction in the Dockerfile does:

  • Base Image: Starts with sdflysha/choco:latest which includes Chocolatey.
  • Development Tools Installation: Uses Chocolatey to install git, cmake, python, and visualstudio2017-workload-vctools.
  • vcpkg Setup: Clones vcpkg from its official repository, bootstraps it, adds it to the system PATH, and installs/removes zlib as a demonstration.
  • Entry Point: Configures the container to open with the Visual Studio 2017 build tools' environment setup, readying it for command-line usage.

⁠Contributions and License

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.

⁠Acknowledgments

  • The base image and tools leveraged herein rely on public contributions and official sources from Microsoft and the respective tool maintainers.

For more information regarding the tools used in this image, refer to their respective websites:

Thank you for choosing sdflysha/msvc2017 for your development needs.

Tag summary

Content type

Image

Digest

sha256:9af70ceeb…

Size

5 GB

Last updated

over 1 year ago

docker pull sdflysha/msvc2017