运行Kitura Docker Image导致libmysqlclient.so.18错误 [英] Run Kitura Docker Image causes libmysqlclient.so.18 Error

查看:185
本文介绍了运行Kitura Docker Image导致libmysqlclient.so.18错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我遇到一些以前的问题以将我的MySQL Kitura设置为Dockerise之后,请在此处进行操作:

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

我遇到了一个新问题,我无法按照以下指南解决问题: https ://www.kitura.io/docs/deploying/docker.html .

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

我按照所有步骤进行操作,并且还以前解决了MySQL问题,现在我可以运行以下命令:

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

我假设某些尝试再次尝试从错误的环境目录中打开libmysqclclient?

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

但是我该如何通过构建docker映像来解决此问题...有什么办法和更好的智能方法?

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.

推荐答案

我能够更新和增强我的dockerfile,该文件现在运行平稳,还可以用于CI和CD任务.

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" ] 

这篇关于运行Kitura Docker Image导致libmysqlclient.so.18错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆