JiscSD / archivematica

Free and open-source digital preservation system designed to maintain standards-based, long-term access to collections of digital objects.
http://www.archivematica.org
GNU Affero General Public License v3.0
0 stars 0 forks source link

Problem: libmysqlclient-dev error when building mcp-server #75

Closed mamedin closed 6 years ago

mamedin commented 6 years ago

I have problems building the archivematica-mcp-server image. The base image python:2.7 now uses Debian Stretch (version 9) instead of Debian Jessie (version 8) . The package libmysqlclient-dev doesn’t exist in Debian 9 that uses default-libmysqlclient-dev instead.

This is the error I get:

failed: [localhost] (item=({'_ansible_ignore_errors': None, 'changed': True, '_ansible_item_result': True, 'invocation': {'module_args': {'key_file': None, 'update': True, 'dest': './src/archivematica', 'track_submodules': False, 'executable': None, 'depth': None, 'accept_hostkey': True, 'repo': 'https://github.com/JiscRDSS/archivematica', 'ssh_opts': None, 'reference': None, 'bare': False, 'refspec': None, 'clone': True, 'remote': 'origin', 'force': False, 'verify_commit': False, 'recursive': True, 'umask': None, 'version': 'v0.6.2', 'archive': None}}, 'after': 'b7446c5dc86ab230e1894bbe1a7f7095923a7762', 'before': None, '_ansible_no_log': False, 'failed': False, '_ansible_parsed': True, 'item': {'repo': 'https://github.com/JiscRDSS/archivematica', 'version': 'v0.6.2', 'dest': './src/archivematica', 'name': 'Archivematica (JiscRDSS fork)'}}, {'path': './src/archivematica/src/', 'dockerfile': 'MCPServer.Dockerfile', 'name': '458323522494.dkr.ecr.eu-west-2.amazonaws.com/archivematica-mcp-server'})) => {"changed": true, "cmd": ["docker", "build", "-t", "458323522494.dkr.ecr.eu-west-2.amazonaws.com/archivematica-mcp-server:v0.6.2", "--build-arg", "ARCHIVEMATICA_VERSION=v0.6.0-rc5", "--build-arg", "AGENT_CODE=v0.6.0-rc5", "-f", "MCPServer.Dockerfile", "."], "delta": "0:00:17.374847", "end": "2018-05-24 17:03:41.154982", "item": [{"_ansible_ignore_errors": null, "_ansible_item_result": true, "_ansible_no_log": false, "_ansible_parsed": true, "after": "b7446c5dc86ab230e1894bbe1a7f7095923a7762", "before": null, "changed": true, "failed": false, "invocation": {"module_args": {"accept_hostkey": true, "archive": null, "bare": false, "clone": true, "depth": null, "dest": "./src/archivematica", "executable": null, "force": false, "key_file": null, "recursive": true, "reference": null, "refspec": null, "remote": "origin", "repo": "https://github.com/JiscRDSS/archivematica", "ssh_opts": null, "track_submodules": false, "umask": null, "update": true, "verify_commit": false, "version": "v0.6.2"}}, "item": {"dest": "./src/archivematica", "name": "Archivematica (JiscRDSS fork)", "repo": "https://github.com/JiscRDSS/archivematica", "version": "v0.6.2"}}, {"dockerfile": "MCPServer.Dockerfile", "name": "458323522494.dkr.ecr.eu-west-2.amazonaws.com/archivematica-mcp-server", "path": "./src/archivematica/src/"}], "msg": "non-zero return code", "rc": 100, "start": "2018-05-24 17:03:23.780135", "stderr": "The command '/bin/sh -c set -ex \t&& apt-get update \t&& apt-get install -y --no-install-recommends \t\tgettext \t\tlibmysqlclient-dev \t\tlibldap2-dev \t\tlibsasl2-dev \t\tlocales \t\tlocales-all \t&& rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100", "stderr_lines": ["The command '/bin/sh -c set -ex \t&& apt-get update \t&& apt-get install -y --no-install-recommends \t\tgettext \t\tlibmysqlclient-dev \t\tlibldap2-dev \t\tlibsasl2-dev \t\tlocales \t\tlocales-all \t&& rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100"], "stdout": "Sending build context to Docker daemon  11.31MB\r\r\nStep 1/22 : FROM python:2.7\n ---> 5a7d0660d94a\nStep 2/22 : ENV DEBIAN_FRONTEND noninteractive\n ---> Using cache\n ---> d4c6fccddc04\nStep 3/22 : ENV DJANGO_SETTINGS_MODULE settings.common\n ---> Running in ea4b6fc08bcb\nRemoving intermediate container ea4b6fc08bcb\n ---> 694b76f9f9bf\nStep 4/22 : ENV PYTHONPATH /src/MCPServer/lib/:/src/archivematicaCommon/lib/:/src/dashboard/src/\n ---> Running in bacbc887305d\nRemoving intermediate container bacbc887305d\n ---> b8ae0d77ed15\nStep 5/22 : ENV PYTHONUNBUFFERED 1\n ---> Running in a71fea49f3b8\nRemoving intermediate container a71fea49f3b8\n ---> 7aec68ce6a08\nStep 6/22 : RUN set -ex \t&& apt-get update \t&& apt-get install -y --no-install-recommends \t\tgettext \t\tlibmysqlclient-dev \t\tlibldap2-dev \t\tlibsasl2-dev \t\tlocales \t\tlocales-all \t&& rm -rf /var/lib/apt/lists/*\n ---> Running in d2263290b2e8\n\u001b[91m+ apt-get update\n\u001b[0mIgn:1 http://deb.debian.org/debian stretch InRelease\nGet:2 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]\nGet:3 http://deb.debian.org/debian stretch Release [118 kB]\nGet:4 http://deb.debian.org/debian stretch Release.gpg [2434 B]\nGet:5 http://deb.debian.org/debian stretch-updates/main amd64 Packages [12.1 kB]\nGet:6 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]\nGet:7 http://deb.debian.org/debian stretch/main amd64 Packages [9530 kB]\nGet:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [440 kB]\nFetched 10.3 MB in 0s (10.8 MB/s)\nReading package lists...\n\u001b[91m+ apt-get install -y --no-install-recommends gettext libmysqlclient-dev libldap2-dev libsasl2-dev locales locales-all\n\u001b[0mReading package lists...\nBuilding dependency tree...\nReading state information...\nPackage libmysqlclient-dev is not available, but is referred to by another package.\nThis may mean that the package is missing, has been obsoleted, or\nis only available from another source\n\n\u001b[91mE: Package 'libmysqlclient-dev' has no installation candidate\n\u001b[0m", "stdout_lines": ["Sending build context to Docker daemon  11.31MB", "", "Step 1/22 : FROM python:2.7", " ---> 5a7d0660d94a", "Step 2/22 : ENV DEBIAN_FRONTEND noninteractive", " ---> Using cache", " ---> d4c6fccddc04", "Step 3/22 : ENV DJANGO_SETTINGS_MODULE settings.common", " ---> Running in ea4b6fc08bcb", "Removing intermediate container ea4b6fc08bcb", " ---> 694b76f9f9bf", "Step 4/22 : ENV PYTHONPATH /src/MCPServer/lib/:/src/archivematicaCommon/lib/:/src/dashboard/src/", " ---> Running in bacbc887305d", "Removing intermediate container bacbc887305d", " ---> b8ae0d77ed15", "Step 5/22 : ENV PYTHONUNBUFFERED 1", " ---> Running in a71fea49f3b8", "Removing intermediate container a71fea49f3b8", " ---> 7aec68ce6a08", "Step 6/22 : RUN set -ex \t&& apt-get update \t&& apt-get install -y --no-install-recommends \t\tgettext \t\tlibmysqlclient-dev \t\tlibldap2-dev \t\tlibsasl2-dev \t\tlocales \t\tlocales-all \t&& rm -rf /var/lib/apt/lists/*", " ---> Running in d2263290b2e8", "\u001b[91m+ apt-get update", "\u001b[0mIgn:1 http://deb.debian.org/debian stretch InRelease", "Get:2 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]", "Get:3 http://deb.debian.org/debian stretch Release [118 kB]", "Get:4 http://deb.debian.org/debian stretch Release.gpg [2434 B]", "Get:5 http://deb.debian.org/debian stretch-updates/main amd64 Packages [12.1 kB]", "Get:6 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]", "Get:7 http://deb.debian.org/debian stretch/main amd64 Packages [9530 kB]", "Get:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [440 kB]", "Fetched 10.3 MB in 0s (10.8 MB/s)", "Reading package lists...", "\u001b[91m+ apt-get install -y --no-install-recommends gettext libmysqlclient-dev libldap2-dev libsasl2-dev locales locales-all", "\u001b[0mReading package lists...", "Building dependency tree...", "Reading state information...", "Package libmysqlclient-dev is not available, but is referred to by another package.", "This may mean that the package is missing, has been obsoleted, or", "is only available from another source", "", "\u001b[91mE: Package 'libmysqlclient-dev' has no installation candidate", "\u001b[0m"]}
mamedin commented 6 years ago

I think it could be fixed using FROM python:2.7-jessie instead of FROM python:2.7 at MCPServer.Dockerfile:

diff --git a/src/MCPServer.Dockerfile b/src/MCPServer.Dockerfile
index 91d02009..d18bf84f 100644
--- a/src/MCPServer.Dockerfile
+++ b/src/MCPServer.Dockerfile
@@ -1,4 +1,4 @@
-FROM python:2.7
+FROM python:2.7-jessie

 ENV DEBIAN_FRONTEND noninteractive
 ENV DJANGO_SETTINGS_MODULE settings.common
jhsimpson commented 6 years ago

That sounds like a good solution here - definitely a problem with using that docker tag 'python-2.7' and trying to have reproducible builds.

I think 'python-2.7-jessie' is the best choice now, we could try jessie-slim or alpine after this to try and reduce the image size, but those options probably require additional changes to work.