Skip to content

Commit d15c3ab

Browse files
authored
Merge branch 'main' into release/lifecycle/0.12.0
2 parents 8a248cd + 21caae0 commit d15c3ab

File tree

3 files changed

+97
-13
lines changed

3 files changed

+97
-13
lines changed

.github/bug_report.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
### **Describe the bug**
2+
A clear and concise description of what the bug is.
3+
4+
### **To Reproduce**
5+
Steps to reproduce the behavior:
6+
1. Go to '...'
7+
2. Click on '....'
8+
3. Scroll down to '....'
9+
4. See error
10+
11+
### **Expected behavior**
12+
A clear and concise description of what you expected to happen.
13+
14+
### **Screenshots**
15+
If applicable, add screenshots or screen captures to help explain your problem.
16+
17+
### **Additional context**
18+
Add any other context about the problem here.
19+
20+
<hr/>
21+
22+
<!--- Do not remove or change this in the issue description. Only update the details above this. --->
23+
**Note:**
24+
* If you want to work on an issue, you should check if it has already been assigned to anyone. **If the issue is free** and you would like to be assigned to it please comment on the issue.
25+
* If you are raising a new issue and want to work on it then also you should comment to get assigned.
26+
* Please **refrain from** adding labels to your issue/pull-request on your own. It is the job of the Project Admin and the Mentors to review your issue/pull-request and add labels accordingly.
27+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
+++
2+
title="Using Buildpacks with a Proxy"
3+
weight=8
4+
summary="Learn how to use buildpacks behind a HTTP proxy."
5+
+++
6+
7+
Many university or corporate environments use a proxy to access HTTP and HTTPS resources on the web. Proxies introduce two constraints on buildpack built applications:
8+
9+
1. `pack` needs to download buildpacks through the proxies, and
10+
2. applications running in containers created by `pack` need to call APIs behind the proxy.
11+
12+
We show how to solve both of these constraints.
13+
14+
## Making `pack` Proxy Aware
15+
16+
You may need the `pack` command-line tool to download buildpacks and images via your proxy. Building an application with an incorrectly configured proxy results in errors such as the following:
17+
18+
```console
19+
$ pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:bionic
20+
ERROR: failed to build: failed to fetch builder image 'index.docker.io/cnbs/sample-builder:bionic'
21+
: Error response from daemon: Get "https//registry-1.docker.io/v2/": context deadline exceeded
22+
```
23+
24+
The `pack` tool uses the Docker daemon to manage the local image registry on your machine. The `pack` tool will ask the Docker daemon to download buildpacks and images for you. Because of this relationship, between `pack` and the Docker daemon, we need to configure the Docker daemon to use a HTTP proxy. The approach to setting the HTTP proxy depends on your platform:
25+
26+
27+
### Docker Desktop (Windows and MacOS)
28+
Docker's documetation states "Docker Desktop lets you configure HTTP/HTTPS Proxy Settings and automatically propagates these to Docker". Set the system proxy using the [MacOS documentation](https://support.apple.com/en-gb/guide/mac-help/mchlp2591/mac) or [Windows documentation](https://www.dummies.com/computers/operating-systems/windows-10/how-to-set-up-a-proxy-in-windows-10/). The system proxy settings will be used by Docker Desktop.
29+
30+
### Linux
31+
The Docker project documents [how to configure configure the HTTP/HTTPS proxy](https://docs.docker.com/config/daemon/systemd/#httphttps-proxy) settings for the Docker daemon on Linux. You should configure the `HTTP_PROXY` and `HTTPS_PROXY` environment variables as part of the Docker daemon startup.
32+
33+
## Proxy Settings for Buildpacks
34+
35+
Buildpacks may also need to be aware of your http and https proxies at build time. For example python, java and nodejs buildpacks need to be aware of proxies in order to resolve dependencies. To make buildpacks aware of proxies, export the `http_proxy` and `https_proxy` environment variables before invoking `pack`. For example:
36+
37+
```console
38+
export http_proxy=http://user:[email protected]:3128
39+
export https_proxy=https://my-proxy.example.com:3129
40+
pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:bionic
41+
```
42+
43+
## Making your Application Proxy Aware
44+
45+
Your application may need to use http or https proxies to access web-based APIs. In order to make proxy settings available inside containers you should edit your `~/.docker/config.json` file (`%USERPROFILE%\.docker\config.json` on Windows) to contain the proxy information. The `httpProxy`, `httpsProxy` and `noProxy` properties of this configuration file are injected into containers at build time and at run time as the `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` environment variables respectively. Both the http and https proxy settings are also injected in their lower-case form as `http_proxy` and `https_proxy`.
46+
47+
```json
48+
{
49+
"proxies": {
50+
"default": {
51+
"httpProxy": "http://user:[email protected]:3128",
52+
"httpsProxy": "https://my-proxy.example.com:3129",
53+
"noProxy": "internal.mycorp.example.com"
54+
}
55+
}
56+
}
57+
```
58+
59+
If your application requires a http or https proxy, then you should prefer to read proxy information from the lower-case `http_proxy` and `https_proxy` variables.

content/docs/concepts/components/buildpack.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,35 @@ weight=2
55

66
## What is a buildpack?
77

8-
A buildpack is a unit of work that inspects your app source code and formulates a plan to build and run your
9-
application.
8+
A buildpack is a set of executables that inspects your app source code and create a plan to build and run your application.
109

1110
<!--more-->
1211

13-
Typical buildpacks are a set of at least three files:
12+
Typical buildpacks consist of at least three files:
1413

1514
* `buildpack.toml` -- provides metadata about your buildpack
1615
* `bin/detect` -- determines whether buildpack should be applied
17-
* `bin/build` -- executes buildpack logic
16+
* `bin/build` -- executes build logic
1817

1918
#### Meta-buildpack
2019

2120
There is a different type of buildpack commonly referred to as a **meta-buildpack**. It contains only a
2221
`buildpack.toml` file with an `order` configuration that references other buildpacks. This is useful for
2322
composing more complex detection strategies.
2423

25-
## Anatomy of a buildpack
24+
## Buildpack phases
2625

27-
There are two essential phases that allow buildpacks to create a runnable image.
26+
There are two essential steps that allow buildpacks to create a runnable image.
2827

2928
#### Detect
3029

31-
A platform sequentially tests groups of buildpacks against your app's source code. The first group that deems itself
32-
fit for your source code will become the selected set of buildpacks for your app. Detection criteria is specific to each
33-
buildpack -- for instance, an **NPM buildpack** might look for a `package.json`, and a **Go buildpack** might look for
34-
Go source files.
30+
A [platform][platform] sequentially tests [groups][buildpack-group] of buildpacks against your app's source code. The first group that deems itself fit for your source code will become the selected set of buildpacks for your app.
31+
32+
Detection criteria is specific to each buildpack -- for instance, an **NPM buildpack** might look for a `package.json`, and a **Go buildpack** might look for Go source files.
3533

3634
#### Build
3735

38-
During build the buildpacks contribute to the final application image. This contribution could be as simple as setting
39-
some environment variables within the image, creating a layer containing a binary (e.g: node, python, or ruby), or
40-
adding app dependencies (e.g: running `npm install`, `pip install -r requirements.txt`, or `bundle install`).
36+
During build the buildpacks contribute to the final application image. This contribution could be as simple as setting some environment variables within the image, creating a layer containing a binary (e.g: node, python, or ruby), or adding app dependencies (e.g: running `npm install`, `pip install -r requirements.txt`, or `bundle install`).
4137

4238
## Distribution
4339

@@ -48,4 +44,6 @@ Buildpacks can be [packaged][package-a-buildpack] as OCI images on an image regi
4844
Learn more about buildpacks by referring to the [Buildpack API][buildpack-api].
4945

5046
[buildpack-api]: /docs/reference/buildpack-api
47+
[buildpack-group]: /docs/concepts/components/buildpack-group/
5148
[package-a-buildpack]: /docs/buildpack-author-guide/package-a-buildpack/
49+
[platform]: /docs/concepts/components/platform

0 commit comments

Comments
 (0)