Harbor

Harbor Julia package repo.

Harbor.docker_execMethod
docker_exec(container_id::String, exec_cmd::AbstractVector{<:AbstractString};
            detach::Bool=false, detach_keys::Union{Nothing,AbstractString}=nothing,
            env::Union{Nothing,AbstractDict{<:AbstractString,<:AbstractString}}=nothing,
            env_file::Union{Nothing,AbstractString,AbstractVector{<:AbstractString}}=nothing,
            interactive::Bool=false, privileged::Bool=false, tty::Bool=false,
            user::Union{Nothing,AbstractString}=nothing,
            workdir::Union{Nothing,AbstractString}=nothing) -> String

Runs docker exec on the specified container. Returns the command output as a string.

source
Harbor.docker_killMethod
docker_kill(container_id::String; signal::Union{String,Int}="SIGTERM") -> Bool

Runs docker kill --signal=<signal> <container_id>. Returns true if successful.

source
Harbor.docker_logsMethod
docker_logs(container_id::String; follow::Bool=false, tail::Union{String,Int}="all") -> String

Runs docker logs with optional follow and tail parameters, returning the log output.

source
Harbor.docker_psMethod
docker_ps(; all::Bool=false) -> Vector{String}

Runs docker ps (or docker ps -a if all is true) and returns a vector of container IDs.

source
Harbor.docker_pullMethod
docker_pull(image_name::String; tag::String="latest") -> Image

Runs docker pull <image_name>:<tag>. On success, returns an Image struct.

source
Harbor.docker_restartMethod
docker_restart(container_id::String; timeout::Int=10) -> Bool

Runs docker restart --timeout=<timeout> <container_id>. Returns true if successful.

source
Harbor.docker_rmMethod
docker_rm(container_id::String; force::Bool=false) -> Bool

Runs docker rm [--force] <container_id>. Returns true if the container is removed.

source
Harbor.docker_rm_imageMethod
docker_rm_image(image::Image; force::Bool=false) -> Bool

Runs docker rmi [--force] <image>. Returns true on success.

source
Harbor.docker_runMethod
docker_run(image::Image; name=nothing, ports=Dict{Int,Int}(),
           volumes=Dict{String,String}(), environment=Dict{String,String}(),
           command=nothing, detach::Bool=false) -> String

Runs docker run with the provided options and returns the container ID.

source
Harbor.docker_startMethod
docker_start(container_id::String) -> Bool

Runs docker start <container_id>. Returns true if successful.

source
Harbor.docker_stopMethod
docker_stop(container_id::String; timeout::Int=10) -> Bool

Runs docker stop --timeout=<timeout> <container_id>. Returns true if successful.

source
Harbor.execMethod

exec(container::Container, exec_cmd::AbstractVector{<:AbstractString}; kw...) -> String

Runs a command inside the specified container.

source
Harbor.logsMethod

logs(container::Container) -> String

Retrieves the logs for the specified container.

source
Harbor.psMethod

ps(; all::Bool=true) -> Vector{Container}

Lists containers. If all is true, lists all containers; otherwise, only running ones.

source
Harbor.pullMethod

pull(image::String; tag::String="latest") -> Image

Pulls an image from a registry and returns an Image instance.

source
Harbor.remove!Method

remove!(container::Container) -> Bool

Removes a container from the system. Returns true if successful.

source
Harbor.removeMethod

remove(image::Image; force::Bool=false) -> Bool

Removes the specified image.

source
Harbor.run!Method

run!(image::Image; name=nothing, ports=Dict{Int,Int}(), volumes=Dict{String,String}(), environment=Dict{String,String}(), command=nothing, detach::Bool=false) -> Container

Starts a container from the provided Image with the specified options. Returns a Container instance reflecting the running state.

source
Harbor.stop!Method

stop!(container::Container; timeout::Int=10) -> Container

Gracefully stops a running container. Returns the Container with a new status.

source
Harbor.wait_forMethod
wait_for(container::Container)

Waits until the given strategy condition is met or the timeout expires. Throws an error if the wait condition isn't satisfied in time.

source
Harbor.with_containerMethod

with_container(image::Image; kw...) do container # operations on container end

Runs a container with the specified image and keyword options. The container is automatically stopped and removed after the block completes (even if an error occurs).

source