如何使用新的buildpacks.io框架部署heroku-nginx构建包



我遵循本教程为nginx:部署一个自定义的heroku构建包

http://jkutner.github.io/2020/05/26/cloud-native-buildpacks-shim.html

当我部署原始的heroku nginx构建包时:https://github.com/heroku/heroku-buildpack-nginx

在使用pack编译和构建它之后,会抛出以下错误:

cp: 'bin/start-nginx' and '/workspace/bin/start-nginx' are the same file

这就是编译脚本的样子:

#!/usr/bin/env bash
set -e
# clean up leaking environment
unset GIT_DIR
# parse and derive params
BUILD_DIR=my_nginx
CACHE_DIR=$2
BUILDPACK_DIR="$(dirname "$(dirname "$0")")"
mkdir -p "$BUILD_DIR/bin/"
mkdir -p "$BUILD_DIR/nginx"
tar -zxvf "nginx-$STACK".tgz -C "$BUILD_DIR/nginx"
cp "$BUILD_DIR/nginx/nginx" "$BUILD_DIR/bin/nginx"
cp "$BUILD_DIR/nginx/nginx-debug" "$BUILD_DIR/bin/nginx-debug"
nginx_version=$($BUILD_DIR/bin/nginx -V 2>&1 | head -1 | awk '{ print $NF }')
echo "-----> nginx-buildpack: Installed ${nginx_version} to app/bin"
cp bin/start-nginx "$BUILD_DIR/bin/"
echo '-----> nginx-buildpack: Added start-nginx to app/bin'
cp bin/start-nginx-debug "$BUILD_DIR/bin/"
echo '-----> nginx-buildpack: Added start-nginx-debug to app/bin'
cp bin/start-nginx-solo "$BUILD_DIR/bin/"
echo '-----> nginx-buildpack: Added start-nginx-solo to app/bin'
mkdir -p "$BUILD_DIR/config"
if [[ ! -f $BUILD_DIR/config/mime.types ]]; then
cp "$BUILD_DIR/nginx/mime.types" "$BUILD_DIR/config/"
echo '-----> nginx-buildpack: Default mime.types copied to app/config/'
else
echo '-----> nginx-buildpack: Custom mime.types found in app/config.'
fi
if [[ ! -f $BUILD_DIR/config/nginx.conf.erb ]]; then
cp config/nginx.conf.erb "$BUILD_DIR/config/"
echo '-----> nginx-buildpack: Default config copied to app/config.'
else
echo '-----> nginx-buildpack: Custom config found in app/config.'
fi
# cleanup
rm -r "$BUILD_DIR/nginx"
exit 0

这个构建包坏了吗?由于heroku导致了这些问题,我在哪里可以找到合适的nginx构建包?

您可以参考下面的文章并从中获得帮助。此外,我还提供了Heroku Nginx包的链接,这是最可取的一个。

文章:https://koed00.github.io/Heroku_setups/

包装:https://github.com/heroku/heroku-buildpack-nginx

相关内容

  • 没有找到相关文章

最新更新