本文介绍了如何避免从Bluemix的缓存中加载buildpack组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我推入或重新登台应用程序时,我都希望从互联网上自动下载buildpack的所有组件,以确保我拥有最新版本。

I want to automatically download all components of my buildpack from the internet every time I push or re-stage my application to be assured I have the latest versions.

当前,我看到正在为

jboss buildpack :https://github.com/cloudfoundry-community/jboss-buildpack. 
-----> Downloaded app package (14M)
-----> Downloaded app buildpack cache (181M)
Cloning into '/tmp/buildpacks/jboss-buildpack'...
-----> Java Buildpack Version: b96641c | https://github.com/cloudfoundry-community/jboss-buildpack#b96641c
-----> Downloading Open Jdk JRE 1.8.0_45 from https://download.run.pivotal.io/openjdk/trusty/x86_64/openjdk-1.8.0_45.tar.gz (found in cache)


推荐答案

我发现某些buildpack是用代码编写的,以避免加载过时的组件来减轻这种担忧。

I discovered that certain buildpacks are written with code to avoid loading stale components alleviating this concern.

例如:

Cloudfoundry Java buildpack :具有内置机制,可确保始终使用最新版本的二进制文件它需要。 详细解释。

Cloudfoundry Java buildpack : https://github.com/cloudfoundry/java-buildpack has a built-in mechanism to make sure it always uses latest version of the binaries it needs. https://github.com/cloudfoundry/java-buildpack/blob/master/docs/extending-caches.md explains this in detail.

Cloudfoundry Node buildpack :使用环境变量具有类似的功能。您可以创建一个CF环境变量: NODE_MODULES_CACHE false
,这将强制Node.js buildpack每次都会从Internet下载节点模块。

Cloudfoundry Node buildpack : https://github.com/cloudfoundry/nodejs-buildpack has similar functionality using environment variables. You can create a CF environment variable : "NODE_MODULES_CACHE false"which will force the Node.js buildpack will download node modules from the internet every time.

如果您不确定所使用的buildpack是否提供此机制,请执行以下步骤:

If you are in not sure the buildpack you are using doesn't offer this mechanism , perform following steps :

1)叉空buildpack:

1) Fork null buildpack : https://github.com/ryandotsmith/null-buildpack

2 )将 rm -rfv $ 2 / * 添加到 null-buildpack / bin / compile 文件并提交

2) add : " rm -rfv $2/* " to null-buildpack/bin/compile file and commit

3)使用第2步中经过修改的buildpack推送您的应用程序,此步骤将完全删除缓存文件夹中的内容

3) push your application with modified buildpack from Step #2, this step will completely delete contents in cache folder

4)使用所需的build pack推送您的应用程序。

4) push your application with your desired build pack.

(参考:)

这篇关于如何避免从Bluemix的缓存中加载buildpack组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-09 23:31