|
1
|
+
|
|
2
|
+.. _bst_and_docker:
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+BuildStream and Docker
|
|
6
|
+======================
|
|
7
|
+
|
|
8
|
+BuildStream integrates with Docker in multiple ways. Here are some ways in
|
|
9
|
+which these integrations work.
|
|
10
|
+
|
|
11
|
+Run BuildStream inside Docker
|
|
12
|
+-----------------------------
|
|
13
|
+
|
|
14
|
+Refer to the :ref:`BuildStream inside Docker <docker>` documentation for
|
|
15
|
+instructions on how to run BuildStream as a Docker container.
|
|
16
|
+
|
|
17
|
+Generate Docker images
|
|
18
|
+----------------------
|
|
19
|
+
|
|
20
|
+The
|
|
21
|
+`bst-docker-import script <https://gitlab.com/BuildStream/buildstream/blob/master/contrib/bst-docker-import>`_
|
|
22
|
+can be used to generate a Docker image from built artifacts.
|
|
23
|
+
|
|
24
|
+You can download it and make it executable like this:
|
|
25
|
+
|
|
26
|
+.. code:: bash
|
|
27
|
+
|
|
28
|
+ mkdir -p ~/.local/bin
|
|
29
|
+ curl --get https://gitlab.com/BuildStream/buildstream/raw/master/contrib/bst-docker-import > ~/.local/bin/bst-docker-import
|
|
30
|
+ chmod +x ~/.local/bin/bst-docker-import
|
|
31
|
+
|
|
32
|
+Check if ``~/.local/bin`` appears in your PATH environment variable -- if it
|
|
33
|
+doesn't, you should
|
|
34
|
+`edit your ~/.profile so that it does <https://stackoverflow.com/questions/14637979/>`_.
|
|
35
|
+
|
|
36
|
+Once the script is available in your PATH and assuming you have Docker
|
|
37
|
+installed, you can start using the ``bst-docker-import`` script. Here is a
|
|
38
|
+minimal example to generate an image called ``bst-hello`` from an element
|
|
39
|
+called ``hello.bst`` assuming it is already built:
|
|
40
|
+
|
|
41
|
+.. code:: bash
|
|
42
|
+
|
|
43
|
+ bst-docker-import -t bst-hello hello.bst
|
|
44
|
+
|
|
45
|
+This script can also be used if you are running BuildStream inside Docker. In
|
|
46
|
+this case, you will need to supply the command that you are using to run
|
|
47
|
+BuildStream using the ``-c`` option. If you are using the
|
|
48
|
+`bst-here wrapper script <https://gitlab.com/BuildStream/buildstream/blob/master/contrib/bst-here>`_,
|
|
49
|
+you can achieve the same results as the above example like this:
|
|
50
|
+
|
|
51
|
+.. code:: bash
|
|
52
|
+
|
|
53
|
+ bst-docker-import -c bst-here -t bst-hello hello.bst
|