Skip to main content

create_user

Function create_user 

Source
pub async fn create_user(
    client: &DockerClient,
    container: &str,
    username: &str,
) -> Result<(), DockerError>
Expand description

Create a new user in the container

Creates a user with a home directory and /bin/bash shell. Returns an error if the user already exists.

§Arguments

  • client - Docker client
  • container - Container name or ID
  • username - Username to create

§Example

create_user(&client, "opencode-cloud", "admin").await?;