paleozogt / MSVCDocker

MSVC via Wine in Docker
121 stars 20 forks source link

Build and efficiency fixes #7

Closed gerph closed 4 years ago

gerph commented 4 years ago

1. Avoid downloading the large zip file if we already have it.

There is no point in downloading the large file if it is already present on the disc. It's possible that it might have failed to fully download, but the unzip will at least tell you that. The unzip could also protect against extracting the file again, but the unzip is cheap compared the 4GB download of a zip. [ Running out of disc space during the zip extract caused me to have to re-download the image, which was frustrating ].

2. Move docker build to a subdirectory; upgrade wine to 4.0.2.

When the docker build was being run, it did so in the root directory, which contains the downloaded zip file and the extracted contents of that zip, in addition to the snapshots it required. This meant that the build was transferring about 11GB of data to the docker daemon to make available to the build system - not a fast or useful operation.

Moving the docker build to happen in a separate directory, which contains only the things that are needed by the Docker build, means that we only transfer about 2.8GB to the docker daemon, and it runs a lot faster.

To make this work, the snapshots need to be created in a different place so that they may be accessed by the docker, but aren't in the same location as the builds. For ease, I've just symlink'd these directories in the makefile.

Wine version 4.0 was previously required - but this does not appear to install at the present time (August 2019). Upgrading the version required to 4.0.2 in the Makefile allowed this to work.

paleozogt commented 4 years ago

@gerph Thanks for pointing out these problems and submitting a PR!

I didn't end up merging this PR, but I addressed the problems you pointed out:

gerph commented 4 years ago

@gerph Thanks for pointing out these problems and submitting a PR!

I didn't end up merging this PR, but I addressed the problems you pointed out:

Awesome! Thanks. I didn't know about the dockerignore file when I did this - it's the first thing a friend mentioned when I told them about what I had been playing with, so I felt a little silly (and probably should have updated the PR).

Thanks for this very cute way of building things - I'd been looking for a sway to do this for ages, and wasn't quite clever enough to work out the how :-)