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
Copy file name to clipboardExpand all lines: docs/content/documentation/getting-started.md
+32-8Lines changed: 32 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,30 +6,54 @@ draft: false
6
6
7
7
## Installation
8
8
9
+
### Prerequisites
10
+
11
+
It's recommended you add your user to the `docker` group:
12
+
13
+
```shell
14
+
$ sudo usermod -a -G docker USERNAME
15
+
```
16
+
17
+
and logout and in again to pick up the changes.
18
+
19
+
Alternatively you can run `floki` (after installation) with `sudo -E floki`.
20
+
21
+
### Installation from pre-built binaries
22
+
9
23
Precompiled binaries for linux and OSX can be downloaded from the [releases](https://github.com/Metaswitch/floki/releases) page.
10
24
11
25
For example, to obtain the latest binary with `curl` and extract it, run
12
26
13
-
```
27
+
```shell
14
28
$ curl -L https://github.com/Metaswitch/floki/releases/download/0.6.1/floki-0.6.1-linux.tar.gz | tar xzvf -
15
29
```
16
30
17
31
in a shell. You should now be able to run `floki` from your working directory:
18
32
19
-
```
33
+
```shell
20
34
$ ./floki --version
21
35
floki 0.6.1
22
36
```
23
37
24
38
Copy this into your path to run it without needing to specify the path absolutely. E.g.
25
39
40
+
```shell
41
+
$ mv floki /usr/local/bin/
26
42
```
27
-
# mv floki /usr/local/bin/
43
+
44
+
### Installation from cargo
45
+
46
+
`floki` can also be installed directly from `cargo`.
47
+
48
+
```shell
49
+
$ cargo install floki
28
50
```
29
51
52
+
### Shell completions
53
+
30
54
Shell completions can be added to your existing shell session with
31
55
32
-
```
56
+
```shell
33
57
source<(floki completion <shell>)
34
58
```
35
59
@@ -41,21 +65,21 @@ Enjoy!
41
65
42
66
`floki` is configured using a configuration file typically placed in the root of your codebase. As a basic example, write a basic configuration file, and name it `floki.yaml`.
43
67
44
-
```
68
+
```yaml
45
69
image: debian:latest
46
70
init:
47
71
- echo "Welcome to your first floki container!"
48
72
```
49
73
50
74
Now, in the same directory, run
51
75
52
-
```
76
+
```shell
53
77
floki
54
78
```
55
79
56
80
A container will launch with the working directory mounted as your working directory. Verify this by running `ls`:
57
81
58
-
```
82
+
```shell
59
83
$ ls
60
84
... floki.yaml ...
61
85
```
@@ -68,7 +92,7 @@ In general, invoking `floki` in any child directory of this root directory will
68
92
69
93
You can use a different configuration file with `floki` by telling it to use a different file from the command line. For example, if you have another configuration in `config.yaml`, you can run `floki` with
Copy file name to clipboardExpand all lines: docs/content/intro/feature-overview.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ The ideal workflow is
22
22
23
23
Using a prebuilt image (e.g. one from dockerhub or a docker registry) is as simple as providing its name as a top-level key in `floki.yaml`:
24
24
25
-
```
25
+
```yaml
26
26
image: debian:sid
27
27
```
28
28
@@ -34,7 +34,7 @@ Custom registries can be used by configuring `docker` to use these registries. `
34
34
35
35
`floki`can use an image built from a `Dockerfile` in source tree. It's easiest to see an example of `floki.yaml` to see how to configure this.
36
36
37
-
```
37
+
```yaml
38
38
image:
39
39
build:
40
40
name: foo # Will build the image with name foo:floki
@@ -44,9 +44,9 @@ image:
44
44
```
45
45
46
46
## Referencing a key in another yaml file
47
-
`floki` can use an image by reference to another yaml file. This can help keep local development environments sync'd with a CI environment.
47
+
`floki`can use an image by reference to another yaml file. This can help keep local development environments synced with a CI environment.
48
48
49
-
```
49
+
```yaml
50
50
image:
51
51
yaml:
52
52
file: .gitlab-ci.yaml
@@ -67,7 +67,7 @@ The default shell is `sh`.
67
67
68
68
A shell can be set for a container using the top-level `shell` key:
69
69
70
-
```
70
+
```yaml
71
71
image: alpine:latest
72
72
shell: sh
73
73
```
@@ -76,7 +76,7 @@ shell: sh
76
76
77
77
A different shell can be used for initialization and the interactive shell provided to the user.
78
78
79
-
```
79
+
```yaml
80
80
image: alpine:latest
81
81
shell:
82
82
inner: bash
@@ -87,7 +87,7 @@ init:
87
87
88
88
A useful use case here is if you want to run the container with the same user as on the host. `floki` exposes the user id and user group id in environment variables, so you can add a user to the running container and switch to the new user in the inner shell:
89
89
90
-
```
90
+
```yaml
91
91
image: foo:latest
92
92
shell:
93
93
inner: bash
@@ -102,7 +102,7 @@ The commands to make the above work depend on the container you are running. `fl
102
102
103
103
Docker-in-docker (`dind`) can be enabled by setting the top-level `dind` key to `true`.
104
104
105
-
```
105
+
```yaml
106
106
image: foo:bar
107
107
dind: true
108
108
```
@@ -111,7 +111,7 @@ Note that the docker CLI tools are still required in the container, and the dock
111
111
112
112
The precise `dind` image can also be set
113
113
114
-
```
114
+
```yaml
115
115
dind:
116
116
image: docker:stable-dind
117
117
```
@@ -122,7 +122,7 @@ This helps properly pin and version the docker-in-docker container.
122
122
123
123
`floki` has the ability to use volumes for caching build artifacts between runs of the container (amongst other things). Volumes can be configured in `floki.yaml`:
124
124
125
-
```
125
+
```yaml
126
126
volumes:
127
127
cargo-registry:
128
128
mount: /home/rust/.cargo/registry
@@ -132,7 +132,7 @@ The key names the volume (it can be any valid yaml name), while the `mount` key
132
132
133
133
It's also possible to share volumes across different `floki.yaml`s. For example, you may want to share a `cargo` registry across all Rust build containers. These shared volumes are identified by the name given to the volume.
134
134
135
-
```
135
+
```yaml
136
136
volumes:
137
137
cargo-registry:
138
138
shared: true
@@ -162,7 +162,7 @@ You can set where this directory is mounted in the container using the `mount` k
162
162
163
163
Sometimes it is useful to be able to pull dependencies from source code management servers for builds. To make this easier to do in an automated fashion, `floki` can forward and `ssh-agent` socket into the container, and expose its path through `SSH_AUTH_SOCK`.
164
164
165
-
```
165
+
```yaml
166
166
forward_ssh_agent: true
167
167
```
168
168
@@ -172,7 +172,7 @@ You will need to have an `ssh-agent` running on the host before launching `floki
172
172
173
173
`floki`also allows single commands to be run, rather than dropping into an interactive shell.
174
174
175
-
```
175
+
```shell
176
176
$ floki run ls
177
177
floki.yaml
178
178
```
@@ -184,7 +184,7 @@ Note that if you have configured an inner shell, the command will run within the
184
184
185
185
`floki`also allows you to pass additional switches to the underlying docker command, for example to forward port `8080` to the host.
0 commit comments