1

I'm trying to build a basic Docker container based on a tutorial. I am on Windows 10 Home version 2004, and I am using the standard command line. I've created the following Docker file to facilitate this, with the only change from the tutorial's version being my older version of gcc:

FROM gcc:6.3.0

RUN apt-get -qq update
RUN apt-get -qq upgrade
RUN apt-get -qq install cmake

RUN apt-get install libboost-all-dev=1.62.0.1
RUN apt-get -qq install build-essential libtcmalloc-minimal4 && \
    ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc_minimal.so

Once the script gets to the step where it tries to install libboost-all-dev I get the following output:

Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.62.0.1' for 'libboost-all-dev' was not found
The command '/bin/sh -c apt-get install libboost-all-dev=1.62.0.1' returned a non-zero code: 100

and the build stops.

I've tried updating the build script to use the current version of Boost (1.74.0) as well and get the same issue. I'm not really finding any solutions in my research online and the output is not very helpful in trying to figure out what the issue is. Could anyone with more experience with installing Boost as part of the Docker process point me in the right direction?

Kevin
  • 16,549
  • 8
  • 60
  • 74
Blake Simmons
  • 426
  • 1
  • 8
  • 23
  • 1
    I understand this might not end up being helpful, but I feel obliged to ask: Have you tried googling for "docker apt-get return code 100" yet? There are quite a few seemingly relevant results and including multiple SO posts dealing with similar problems for different packages. – Aleon Aug 21 '20 at 23:39
  • I did do several searches, but admittedly, and stupidly, not for the exact error code. I used the error message in my searches and found several similar issues but none exactly like mine, or similar enough that I was able to discern the solution through context. I appreciate the suggestion, and understand that this seems like it would have been easily solved with a Google search. – Blake Simmons Aug 24 '20 at 19:32

1 Answers1

3

The package manager will only be able to install versions of Boost that it knows exist, based on the enabled package manager repositories. There is typically only one version of Boost in the default repositories. In my experience, this applies to any Linux OS that supplies Boost, not only those that are run within a Docker container.

The Docker image you started with, gcc:6.3.0, appears to have only Boost version 1.55.0.2, so requesting any other version will yield the same error.

If you want a different version of Boost in your image, you can follow the typical steps for installing a different version of Boost outside a Docker container. These steps are well-documented on Stack Overflow, or you might find a repository such as this to enable in your package manager to directly install it from apt-get.

Kevin
  • 16,549
  • 8
  • 60
  • 74
  • This solved my issue, thanks. It's really straight forward and I'm ashamed I wasn't able to figure this out on my own. I guess my misconception was that I didn't realize Boost was a part of the gcc package. Would I be correct in assuming that if I updated my version of gcc I'd have to update both the gcc version and the boost version in this script? – Blake Simmons Aug 24 '20 at 19:34
  • 1
    @BlakeSimmons In general, yes, if you change the version of the `gcc` Docker image you start with, you may have to update the version of Boost you request. An small increase (such as to `gcc:6.4.0`) may not require a change in the Boost version, but a large increase may (such as to `gcc:10.2.0`). To avoid this, you can just leave out the Boost version from the request altogether, and allow the package manager to grab whatever Boost version is available: `RUN apt-get install libboost-all-dev`. – Kevin Aug 24 '20 at 20:12