Heroku默认堆栈中没有ping命令(使用Ubuntu 20.04(。我已经使用buildpack安装了"iputils-ping"包,但它没有显示"找不到命令"。还尝试使用buildpack的Aptfile中特定.deb文件的链接。
部署日志显示它已安装,但在完成后,找不到获取命令。无论如何,我是否可以安装该包并使用python脚本中的ping命令进行部署。
$ git push heroku master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 360 bytes | 360.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote: 1. https://github.com/heroku/heroku-buildpack-apt
remote: 2. heroku-community/apt
remote: 3. heroku/python
remote: -----> Apt app detected
remote: -----> Detected Aptfile or Stack changes, flushing cache
remote: -----> Updating apt caches
remote: Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
remote: Hit:2 http://archive.ubuntu.com/ubuntu focal-security InRelease
remote: Hit:3 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
remote: Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
remote: Reading package lists...
remote: -----> Fetching .debs for iputils-ping
remote: Reading package lists...
remote: Building dependency tree...
remote: The following NEW packages will be installed:
remote: iputils-ping
remote: 0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
remote: Need to get 40.1 kB of archives.
remote: After this operation, 108 kB of additional disk space will be used.
remote: Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 iputils-ping amd64 3:20190709-3 [40.1 kB]
remote: Fetched 40.1 kB in 0s (151 kB/s)
remote: Download complete and in download only mode
remote: -----> Fetching http://kr.archive.ubuntu.com/ubuntu/pool/main/i/iputils/iputils-ping_20210202-1_amd64.deb
remote: -----> Installing iputils-ping_20210202-1_amd64.deb
remote: -----> Installing iputils-ping_3%3a20190709-3_amd64.deb
remote: -----> Writing profile script
remote: -----> Rewrite package-config files
remote: -----> Apt app detected
remote: -----> Reusing cache
remote: -----> Updating apt caches
remote: Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
remote: Hit:2 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
remote: Hit:3 http://archive.ubuntu.com/ubuntu focal-security InRelease
remote: Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
remote: Reading package lists...
remote: -----> Fetching .debs for iputils-ping
remote: Reading package lists...
remote: Building dependency tree...
remote: The following NEW packages will be installed:
remote: iputils-ping
remote: 0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
remote: Need to get 0 B/40.1 kB of archives.
remote: After this operation, 108 kB of additional disk space will be used.
remote: Download complete and in download only mode
remote: -----> Fetching http://kr.archive.ubuntu.com/ubuntu/pool/main/i/iputils/iputils-ping_20210202-1_amd64.deb
remote: -----> Installing iputils-ping_20210202-1_amd64.deb
remote: -----> Installing iputils-ping_3%3a20190709-3_amd64.deb
remote: -----> Writing profile script
remote: -----> Rewrite package-config files
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the same version as the last build: python-3.9.5
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> No change in requirements detected, installing from cache
remote: -----> Using cached install of python-3.9.5
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
它已经安装,但我无法在Python程序中使用此命令,因为"ping"命令需要root权限才能执行Heroku不允许的:(
~ $ which ping
/bin/ping
~ $