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
**Prepare your files.** You must declare the systemd service file and possibly the files you need to run your app (you may have at least an entrypoint file, like a statically compiled binary). Example:
13
+
You need to provide two files:
14
+
15
+
- The systemd service file (like `my-service.service`)
16
+
- Extra files you want to map to the target image (you need to provide one binary at least)
17
+
18
+
Here is an example with a single binary to copy.
14
19
15
20
```ini
16
21
# files.txt
17
22
./my-binary /usr/bin/my-binary
18
23
```
19
24
20
-
**Bundle it**. Give the files as input and set the name of the output file.
21
-
22
-
> [!IMPORTANT]
23
-
> The output file will have the following format: `SERVICE_NAME.raw` where `SERVICE_NAME` is merely the name of your service file (without the `.service` extension)
It creates an image file `my-service.raw` in the current directory. You can modify the output directory with the `-d` option.
30
32
31
-
```sh
32
-
sudo portablectl attach my-service.raw
33
-
sudo systemctl start my-service
33
+
> [!IMPORTANT]
34
+
> It is important to keep this naming convention (if you provide `wtf.service`, it builds `wtf.raw`). Systemd won't accept image with filename different from service name.
35
+
36
+
Finally you can attach your service anywhere (where systemd runs!).
37
+
38
+
```shell
39
+
sudo portablectl attach ./my-service.raw
40
+
# sudo portablectl detach my-service
34
41
```
35
42
43
+
You can look at the [./example](./example/) directory to see a true but basic sample.
44
+
36
45
## Github Action
37
46
47
+
This repo follows the structure of a custom github action. So basically you can integrate `portabledize` to your CI/CD.
0 commit comments