Run Kitura Docker Image causes libmysqlclient.so.18 Error

空扰寡人 提交于 2020-01-05 04:39:06

问题


after i had some previous problem to Dockerise my MySQL Kitura SETUP here : Docker Build Kitura Sqift Container - Shim.h mysql.h file not found

I am running in a new Problem i can not solve following the Guide from : https://www.kitura.io/docs/deploying/docker.html .

After i followed all the steps and also did the fixing on the MySQL issue previously i was now able to run the following command :

docker run -p 8080:8080 -it myapp-run

THis however leads to the following issue :

error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

i assume something tries again to open the libmysqclclient from some wrong Environmental Directories ?

But how can i fix this issues by building the docker images ... is there any way and better a smart way ?

Thanks a lot again for the help.


回答1:


I was able to update and enhance my dockerfile this is now running smoothly and also can be used for CI and CD tasks.


    FROM ibmcom/swift-ubuntu-runtime:latest
    ##FROM ibmcom/swift-ubuntu-runtime:5.0.1

    LABEL maintainer="IBM Swift Engineering at IBM Cloud"
    LABEL Description="Template Dockerfile that extends the ibmcom/swift-ubuntu-runtime image."

    # We can replace this port with what the user wants
    EXPOSE 8080

    # Default user if not provided
    ARG bx_dev_user=root
    ARG bx_dev_userid=1000

    # Install system level packages
    RUN apt-get update && apt-get dist-upgrade -y
    RUN apt-get update && apt-get install -y sudo libmysqlclient-dev

    # Add utils files
    ADD https://raw.githubusercontent.com/IBM-Swift/swift-ubuntu-docker/master/utils/run-utils.sh /swift-utils/run-utils.sh
    ADD https://raw.githubusercontent.com/IBM-Swift/swift-ubuntu-docker/master/utils/common-utils.sh /swift-utils/common-utils.sh
    RUN chmod -R 555 /swift-utils

    # Create user if not root
    RUN if [ $bx_dev_user != "root" ]; then useradd -ms /bin/bash -u $bx_dev_userid $bx_dev_user; fi

    # Bundle application source & binaries
    COPY ./.build /swift-project/.build

    # Command to start Swift application
    CMD [ "sh", "-c", "cd /swift-project && .build/release/Beautylivery_Server_New" ] 



来源:https://stackoverflow.com/questions/57536481/run-kitura-docker-image-causes-libmysqlclient-so-18-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!