我有一个在Heroku上托管的Django项目,它有一个从cirlabs/heroku-buildpack-geodjango分叉的buildpack.有时当我推到Heroku时,它会响应
Counting objects: 16, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 790 bytes, done.
Total 9 (delta 7), reused 0 (delta 0)
-----> Heroku receiving push
-----> Fetching custom buildpack... failed
! Heroku push rejected, error fetching custom buildpack
To git@heroku.com:taplister-staging.git
! [remote rejected] dev -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:heroku-app.git'
Run Code Online (Sandbox Code Playgroud)
我想知道这可能是buildpack本身的一个错误,或者它是否与Heroku如何与github交互?
哦,我的heroku config也是buildpack URL
BUILDPACK_URL: https://github.com/taplister/heroku-buildpack-geodjango …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用JRuby Heroku buildpack(https://github.com/jruby/heroku-buildpack-jruby)来运行一个简单的测试应用程序.
但是,似乎无法编译带有C扩展名的gem.例如,在执行"git push heroku"时,没有C扩展的gem已成功安装,但随后......
Using activerecord (3.1.3)
Using activeresource (3.1.3)
Using bouncy-castle-java (1.5.0146.1)
Using bson (1.7.0)
Installing bson_ext (1.7.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/tmp/build_10vcxrs9ayvxf/jruby/bin/jruby extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.
(root) at /tmp/build_10vcxrs9ayvxf/jruby/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1019
(root) at /tmp/build_10vcxrs9ayvxf/jruby/lib/ruby/shared/rubygems/custom_require.rb:1
(root) at extconf.rb:1
Gem files will remain installed in /tmp/build_10vcxrs9ayvxf/vendor/bundle/jruby/1.9/gems/bson_ext-1.7.0 for inspection.
Results logged to /tmp/build_10vcxrs9ayvxf/vendor/bundle/jruby/1.9/gems/bson_ext-1.7.0/ext/cbson/gem_make.out
An error …Run Code Online (Sandbox Code Playgroud) 这似乎很简单,但我似乎无法弥补这最后的差距.我最近添加GSL通过我的Heroku的基于应用程序的Heroku buildpack为GSL /红宝石.buildpack和相关的GSL gem似乎都按照下面的缩写推送输出正常安装:
$git push staging master
Fetching repository, done.
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 476 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-1.9.3
-----> Installing gsl
-----> Installing dependencies using 1.5.2
Running: bundle install --without development:test --path vendor/bundle --binstubs …Run Code Online (Sandbox Code Playgroud) 我正在使用流星构建包来部署我的流星应用程序。
我希望能够knex在构建包安装结束时运行迁移。
我分叉了 buildpack,在extra目录中添加了一个 shell 脚本(如 README 中所述),其中包含:cd .knex && knex migrate:latest --env staging
.knex不幸的是, buildpack 当前目录中没有任何目录。
我ls -a在 heroku buildpack 期间运行以显示当前目录的内容,但没有目录.knex:
remote: .
remote: ..
remote: app
remote: assets
remote: boot.js
remote: boot-utils.js
remote: config.json
remote: mini-files.js
remote: node_modules
remote: npm
remote: npm-shrinkwrap.json
remote: package.json
remote: packages
remote: program.json
remote: shell-server.js
Run Code Online (Sandbox Code Playgroud)
有什么建议么?
当我运行时npm prune,出现以下(详细)错误
npm info lifecycle elm@0.19.0-bugfix2~install: elm@0.19.0-bugfix2
> elm@0.19.0-bugfix2 install node_modules/elm
> binwrap-install
sh: 1: binwrap-install: not found
npm verb lifecycle elm@0.19.0-bugfix2~install: unsafe-perm in lifecycle true
npm verb lifecycle elm@0.19.0-bugfix2~install: PATH: /tmp/build/.heroku/node/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/tmp/build/apps/web/node_modules/elm/node_modules/.bin:/tmp/build/.heroku/node/bin:/tmp/build/.platform_tools:/tmp/build/.platform_tools/erlang/bin:/tmp/build/.platform_tools/elixir/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle elm@0.19.0-bugfix2~install: CWD: node_modules/elm
npm info lifecycle elm@0.19.0-bugfix2~install: Failed to exec install script
npm timing action:install Completed in 79ms
npm verb unlock done using /app/.npm/_locks/staging-4628ace6b39e4e32.lock for /tmp/build/apps/web/node_modules/.staging
npm timing stage:rollbackFailedOptional Completed in 62ms
npm timing stage:runTopLevelLifecycles Completed in 6364ms
npm WARN optional SKIPPING OPTIONAL …Run Code Online (Sandbox Code Playgroud) 我更新了我的 spring-boot 应用程序以使用 buildpacks 来创建我的 docker-image 而不是 dockerfile。我还在我的应用程序中使用了 Apache POI,并且由于该更新,我在生成 xlsx 文件时收到错误消息。经过一番挖掘,我认为这是因为fontconfig和/或ttf-dejavu包丢失了。但是如何在 dockerimage 中添加这些?使用 dockerfile 我只想添加类似的东西
RUN apt-get update && apt-get install fontconfig ttf-dejavu
Run Code Online (Sandbox Code Playgroud)
但是我如何使用 buildpacks 实现相同的目标?
我的 Spring Boot 应用程序在 Docker 中运行,并由gradlew bootBuildImage. 在 Docker 容器中运行时应用程序无法加载字体
Caused by: java.lang.NullPointerException
at java.desktop/sun.awt.FontConfiguration.getVersion(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
根本原因似乎是缺少fontconfig软件包 ttf-dejavu。使用时Dockerfile,可以使用apk add、yum、apt-get等轻松安装这些软件包
但是https://github.com/paketo-buildpacks/spring-boot和https://github.com/paketo-buildpacks/bellsoft-liberica没有安装其他软件包的选项。
是否有构建包(或配置选项)可以构建具有字体支持的 Docker 映像?
关于将 SpringBoot 项目的构建 Docker 映像从 Dockerfile 迁移到 BuildPacks 的小问题。
我有一个非常简单的 SpringBoot 应用程序,需要容器化。为此,我有一个非常简单的 Dockerfile:
FROM my-custom-java-base-image
RUN install -d -o some-user -g some-user /var/log/supervisor
RUN chmod -R 755 /usr/local/some-user/
EXPOSE 9999
Run Code Online (Sandbox Code Playgroud)
请注意,在这个 Dockerfile 中,有一个自定义的 java 基础镜像,需要运行一些 RUN 命令(以及运行一些其他命令),并公开一个自定义端口,而不是通常的 8080。
这个图像构建得很好,一切都与它配合,非常高兴。
现在,从 SpringBoot 2.3 开始,有了 Buildpacks 集成的新功能,人们可以简单地运行./mvnw spring-boot:build-image并构建一个非常漂亮的分层 Docker 镜像。
这个 Layered Docker 镜像确实非常酷。热门会议上的许多演讲都展示了这种构建图像的新方法的好处:
参考:
https://www.youtube.com/watch?v=44n_MtsggnI
https://www.youtube.com/watch?v=EVHHyiypiY0
然而,在我在网上找到的所有演示中,最初的 Dockerfile 非常简陋,没有自定义端口,没有自定义命令,好像只能用于基本功能
FROM alpine
WORKDIR /tmp
COPY target/myapp.jar myapp.jar
ENTRYPOINT [java -jar blablabla]
Run Code Online (Sandbox Code Playgroud)
到目前为止我尝试的是在插件配置中找到一种从 Dockerfile 中配置我需要的东西的方法
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- …Run Code Online (Sandbox Code Playgroud) 我使用 spring boot 版本 3.0.1 和 java 版本 17 从 start.spring.io 创建了演示项目。
我尝试在终端上执行以下命令来构建 Docker 映像
mvn spring-boot:build-image -Dspring-boot.build-image.imageName=testtesttest
结果出现了错误
[INFO] [creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[INFO] [creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[INFO] [creator] Using Java version 18 extracted from MANIFEST.MF
[INFO] [creator] No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO] [creator] : Contributing to layer
[INFO] [creator] Warning: Dependency has no SHA256. Skipping cache.
[INFO] …Run Code Online (Sandbox Code Playgroud) 我阅读了很多有关该问题的博客,但没有一个解决方法/解决方案对我有用。
我正在使用如下的curl命令
curl -v https://golang.org/dl/?mode=json
* Trying 142.250.80.113:443...
* Connected to golang.org (142.250.80.113) port 443 (#0)
* schannel: disabled automatic use of client certificate
* ALPN: offers http/1.1
* schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
* Closing connection 0
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
Run Code Online (Sandbox Code Playgroud)
我使用以下命令更改了 gitbash (windows) 中的设置以使用 openssl
git config …