无法在Docker Alpine中安装LibreOffice

时间:2018-09-19 06:18:53

标签: docker docker-compose dockerfile alpine docker-build

以前,我使用的是简单的docker映像,而安装LibreOffice并不是一个问题,但是最近我决定移至Alpine Image,因为我的容器尺寸非常大。但是在Alpine映像中,我无法安装libre office。以下是我的docker文件。

FROM python:3.6-alpine3.4
RUN echo "ipv6" >> /etc/modules && apk update && apk add curl bash && apk add --no-cache icu-libs icu-dev libreoffice \
    && apk remove libreoffice-gnome \
    && apk update \
    && apk add install ghostscript
RUN chmod +x entrypoint.sh
EXPOSE 8000
# Entry point and CMD
ENTRYPOINT ["/home/paksign/app/entrypoint.sh"] 

构建我的docker文件时,出现以下错误。

> WARNING: This apk-tools is OLD! Some packages might not function
> properly. ERROR: unsatisfiable constraints:   so:libicui18n.so.60
> (missing):
>     required by:
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]
>                  libreoffice-common-6.0.6.2-r0[so:libicui18n.so.60]

我已经尝试过搜索该问题,但是显然没有可行的解决方案,因此我从stackoverflow那里获得了帮助。任何有什么问题的人请纠正我或提出一些解决方案。在此先感谢:)

更新 以下是我的entrypoint.sh

#!/usr/bin/env bash
set -e

# ToDo Need to enable this
#until psql $DATABASE_URL -c '\l'; do
#  >&2 echo "Postgres is unavailable - sleeping"
#  sleep 1
#done
#
#>&2 echo "Postgres is up - continuing"
cd app
if [ "x$DJANGO_MANAGEPY_MIGRATE" = 'xon' ]; then
    echo "Django starting to migrate un-applied migrations"
    python manage.py migrate --noinput
fi

if [ "x$DJANGO_MANAGEPY_COLLECTSTATIC" = 'xon' ]; then
    echo "Django starting to collect static data"
    python manage.py collectstatic --noinput
fi

if [ "x$DJANGO_LOADDATA" = 'xon' ]; then
    # python manage.py addmedia --source /home/paksign/app/app/document/fixtures/files/c2hvYWliQHd1a2xhLmNvbQ --mediadir c2hvYWliQHd1a2xhLmNvbQ/
    # python manage.py loaddata document/fixtures/initial/documentmeta.json
    # python manage.py loaddata document/fixtures/initial/basepermission.json
    # python manage.py loaddata document/fixtures/initial/signingposition.json
    # python manage.py loaddata document/fixtures/initial/signingpermission.json
    # python manage.py loaddata document/fixtures/initial/baseactivity.json
    # python manage.py loaddata document/fixtures/initial/signingactivity.json
    python manage.py loaddata taxing/fixtures/province-taxing-table-initial-data.json
fi

exec "$@"

1 个答案:

答案 0 :(得分:0)

使用下面的dockerfile格式,并共享一个entrypoint.sh脚本。

FROM alpine:latest