You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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:
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`.
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.
Copy file name to clipboardExpand all lines: content/docs/concepts/components/buildpack.md
+11-13Lines changed: 11 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,39 +5,35 @@ weight=2
5
5
6
6
## What is a buildpack?
7
7
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.
10
9
11
10
<!--more-->
12
11
13
-
Typical buildpacks are a set of at least three files:
12
+
Typical buildpacks consist of at least three files:
14
13
15
14
*`buildpack.toml` -- provides metadata about your buildpack
16
15
*`bin/detect` -- determines whether buildpack should be applied
17
-
*`bin/build` -- executes buildpack logic
16
+
*`bin/build` -- executes build logic
18
17
19
18
#### Meta-buildpack
20
19
21
20
There is a different type of buildpack commonly referred to as a **meta-buildpack**. It contains only a
22
21
`buildpack.toml` file with an `order` configuration that references other buildpacks. This is useful for
23
22
composing more complex detection strategies.
24
23
25
-
## Anatomy of a buildpack
24
+
## Buildpack phases
26
25
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.
28
27
29
28
#### Detect
30
29
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.
35
33
36
34
#### Build
37
35
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
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`).
41
37
42
38
## Distribution
43
39
@@ -48,4 +44,6 @@ Buildpacks can be [packaged][package-a-buildpack] as OCI images on an image regi
48
44
Learn more about buildpacks by referring to the [Buildpack API][buildpack-api].
0 commit comments