Skip to content

Commit 819b18e

Browse files
committed
update README
1 parent 2cbed2e commit 819b18e

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

README.md

+21-10
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,42 @@ wget https://raw.githubusercontent.com/asiffer/portabledize/master/portabledize.
1010

1111
## Get started
1212

13-
**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.
1419

1520
```ini
1621
# files.txt
1722
./my-binary /usr/bin/my-binary
1823
```
1924

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)
25+
Then you can run the script.
2426

25-
```sh
27+
```shell
2628
portabledize.sh -s my-service.service -f files.txt
2729
```
2830

29-
**Attach your service**. Then you can start it!
31+
It creates an image file `my-service.raw` in the current directory. You can modify the output directory with the `-d` option.
3032

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
3441
```
3542

43+
You can look at the [./example](./example/) directory to see a true but basic sample.
44+
3645
## Github Action
3746

47+
This repo follows the structure of a custom github action. So basically you can integrate `portabledize` to your CI/CD.
48+
3849
```yaml
3950
on: [push]
4051

0 commit comments

Comments
 (0)