如何在我的Linux Web App上安装软件包(并使其保持不变)? [英] How do I install packages on my Linux Web App (and make them persist)?

查看:78
本文介绍了如何在我的Linux Web App上安装软件包(并使其保持不变)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Azure Linux Web App上安装PHP应用程序,其中一个先决条件是Mcrypt。


我知道Mcrypt已经被OpenSSL取代,但就像我说的那样,这是我试图安装的应用程序的先决条件,因此任何对此的评论都没有帮助。


获得Mcrypt要工作,我需要安装"libmcrypt-dev"。包,这很容易手动完成:

 apt-get -y install libmcrypt-dev 

但我发现应用程序重启后,程序包消失了。在网上进行了一些相当广泛的搜索之后,我在2017年找到了一篇来自微软的博客文章,其中描述了为什么会发生这种情况,这是有道理的,但并不是特别有用。


HTTPS://blogs.msdn。 microsoft.com/waws/2017/09/08/things-you-should-know-web-apps-and-linux/#PersistHome


/ home之外的文件不坚持。博客文章称通过Dockerfile安装软件包,链接的文档再次无益。它讨论了创建自定义Docker镜像,这似乎是一个漫长而复杂的过程,可以实现
这个简单的任务。必须有一个更简单的方法。


我已经尝试将apt-get命令放在Stack Settings  Startup Command中,以便在容器启动时进行安装,但这导致了" :(应用程序错误"。有趣的是,诊断建议软件包在
之前安装,容器重新启动,没有理由,可能是由于启动超时。


有人可以建议如何我可以安装和保存libmcrypt-dev吗?




MrGoodBytes

解决方案

< blockquote>


你使用的是有福的形象吗?


如果是,那么你可以使用启动脚本来解决这个问题。 

I'm trying to install a PHP app on a Azure Linux Web App and one of the prerequisites is Mcrypt.

I am aware that Mcrypt has been superseded by OpenSSL, but like I said it is a prerequisite for the app I am trying to install, so any commentary around this will not be helpful.

To get Mcrypt to work, I need to install the "libmcrypt-dev" package, which is easy enough to do manually with:

apt-get -y install libmcrypt-dev

But I have found after the app is restarted the package disappears. After some rather extensive searching online I managed to find one blog post from Microsoft back in 2017 which described why this happens, and it makes sense, but isn't particularly helpful.

https://blogs.msdn.microsoft.com/waws/2017/09/08/things-you-should-know-web-apps-and-linux/#PersistHome

Files outside of /home are not persisted. The blog post says to install packages via a Dockerfile, and the documentation linked to is again unhelpful. It talks about creating a custom Docker image which seems to be a long and complicated process to achieve a simple task. There has to be an easier way.

I've tried putting the apt-get command above in the Stack Settings Startup Command to do the install on container startup, but that resulted in a ":( Application Error". Interestingly the diagnostics suggested the package was installing before the container restarted again without reason, possibly due to a startup timeout.

Could anyone suggest how I could get libmcrypt-dev to install and persist?


MrGoodBytes

解决方案

Hi,

Are you using blessed image?

If yes, then you can use startup script to resolve this. 


这篇关于如何在我的Linux Web App上安装软件包(并使其保持不变)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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