Skip to content

Commit 8b84b5e

Browse files
committed
Drop the Buildah dependency and the user-specific customized image
This works by configuring the toolbox container after it has been created, instead of before. The toolbox script itself is mentioned as the entry point of the container, which does 'exec sleep +Inf' once the initialization is done. A new command 'init-container' was added to perform the initialization. It is primarily meant to be used as the entry point for all toolbox containers, and must be run inside the container that's to be initialized. It is not expected to be directly invoked by humans, and cannot be used on the host. As a result, the default name for the toolbox containers is now fedora-toolbox-<version-id>, not fedora-toolbox-<user>-<version-id>. For backwards compatibility, 'toolbox enter' and 'toolbox run' will continue to work with containers using the old naming scheme. https://github.com/debarshiray/toolbox/pull/160
1 parent dadb21d commit 8b84b5e

File tree

6 files changed

+260
-246
lines changed

6 files changed

+260
-246
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ works equally well if you're running e.g. existing Fedora Workstation or
1919
Server, and that's a useful way to incrementally adopt containerization.
2020

2121
The toolbox environment is based on an [OCI](https://www.opencontainers.org/)
22-
image. On Fedora this is the `fedora-toolbox` image. This image is then
23-
customized for the current user to create a toolbox container that seamlessly
24-
integrates with the rest of the operating system.
22+
image. On Fedora this is the `fedora-toolbox` image. This image is used to
23+
create a toolbox container that seamlessly integrates with the rest of the
24+
operating system.
2525

2626
## Usage
2727

2828
### Create your toolbox container:
2929
```
3030
[user@hostname ~]$ toolbox create
31+
Created container: fedora-toolbox-30
32+
Enter with: toolbox enter
3133
[user@hostname ~]$
3234
```
33-
This will create a container, and an image, called
34-
`fedora-toolbox-<your-username>:<version-id>` that's specifically customised
35-
for your host user.
35+
This will create a container called `fedora-toolbox-<version-id>`.
3636

3737
### Enter the toolbox:
3838
```

completion/bash/toolbox

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ __toolbox() {
1313
local MIN_VERSION=29
1414
local RAWHIDE_VERSION=31
1515

16-
local verbose_commands="create enter list run"
16+
local verbose_commands="create enter init-container list run"
1717
local commands="$verbose_commands rm rmi"
1818

1919
declare -A options
2020
local options=([create]="--candidate-registry --container --image --release" \
2121
[enter]="--container --release" \
22+
[init-container]="--home --monitor-host --shell --uid --user" \
2223
[list]="--containers --images" \
2324
[rm]="--all --force" \
2425
[rmi]="--all --force" \

doc/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ manuals = [
88
'toolbox.1',
99
'toolbox-create.1',
1010
'toolbox-enter.1',
11+
'toolbox-init-container.1',
1112
'toolbox-list.1',
1213
'toolbox-rm.1',
1314
'toolbox-rmi.1',

doc/toolbox-init-container.1.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
% toolbox-init-container(1)
2+
3+
## NAME
4+
toolbox\-init\-container - Initialize a running container
5+
6+
## SYNOPSIS
7+
**toolbox init-container** *--home HOME*
8+
*--monitor-host*
9+
*--shell SHELL*
10+
*--uid UID*
11+
*--user USER*
12+
13+
## DESCRIPTION
14+
15+
Initializes a newly created container that's running. It is primarily meant to
16+
be used as the entry point for all toolbox containers, and must be run inside
17+
the container that's to be initialized. It is not expected to be directly
18+
invoked by humans, and cannot be used on the host.
19+
20+
## OPTIONS ##
21+
22+
The following options are understood:
23+
24+
**--home** HOME
25+
26+
Create a user inside the toolbox container whose login directory is HOME.
27+
28+
**--monitor-host**
29+
30+
Ensure that certain configuration files inside the toolbox container are kept
31+
synchronized with their counterparts on the host. Currently, these files are
32+
`/etc/hosts` and `/etc/resolv.conf`.
33+
34+
**--shell** SHELL
35+
36+
Create a user inside the toolbox container whose login shell is SHELL.
37+
38+
**--uid** UID
39+
40+
Create a user inside the toolbox container whose numerical user ID is UID.
41+
42+
**--user** USER
43+
44+
Create a user inside the toolbox container whose login name is LOGIN.
45+
46+
## SEE ALSO
47+
48+
`podman(1)`, `podman-create(1)`, `podman-start(1)`

doc/toolbox.1.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ Create a new toolbox container.
5757

5858
Enter a toolbox container for interactive use.
5959

60+
**toolbox-init-container(1)**
61+
62+
Initialize a running container.
63+
6064
**toolbox-list(1)**
6165

6266
List existing toolbox containers and images.

0 commit comments

Comments
 (0)