Skip to content

Docker image fails to build #16

@Mitvailer

Description

@Mitvailer

After unpacking the latest stable release available at http://dl.mercurylang.org/index.html, executing the command docker build . from the folder should create a docker image, but the build fails for two reasons.

  1. Wrong Docker base image

The Dockerfile uses the image debian:stretch, which has been moved to debian/eol:stretch. It is also possible to use debian:bookworm instead of stretch, in accordance with http://dl.mercurylang.org/deb/.

  1. Failure to retrieve the package

apt-get update && apt-get install -y mercury-rotd-recommended fails with a lot of 404 not found, as it tries to download elements from http://dl.mercurylang.org/deb/pool/main/m/mercury-rotd, while only http://dl.mercurylang.org/deb/pool/main/m/mercury seems to exist.
Mind that changing mercury-rotd-recommended to mercury-recommended fails too: it tries to get elements from http://dl.mercurylang.org/deb/pool/main/m/mercury/, which is a valid directory, but tries for elements of version 20.06-1, like http://dl.mercurylang.org/deb/pool/main/m/mercury/mercury-hlcpar_20.06-1~bpo9+1_amd64.deb, despite only 22.01.8 is available

As I don't know how to make apt-get request the right version, my local workaround is to go fetch the tarball with wget, and manually install mercury.
Mind this workaround seem to run to the end without error, but I have not tried exploiting the generated docker image yet, so it may not be functional at all, but it may still be of assistance for users stumbling on making a docker image :

  1. add wget to the list of packages to install at the beginning of the base image.

  2. add these arguments, to avoid repeating the version

ARG MERCURY_VERSION=22.01.8
ARG MERCURY_SOURCE_DIST_NAME=mercury-srcdist-${MERCURY_VERSION}
  1. replace
            apt-get update && apt-get install -y \
                mercury-recommended \

with

				wget http://dl.mercurylang.org/release/${MERCURY_SOURCE_DIST_NAME}.tar.gz && \
				tar -xvf ${MERCURY_SOURCE_DIST_NAME}.tar.gz && \
				cd ${MERCURY_SOURCE_DIST_NAME} && \
				sh configure && make && make install && \
				PATH="$PATH:/usr/local/mercury-${MERCURY_VERSION}/bin"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions