docker

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CONTAINER_COMMAND = "docker"

Variables

View Source
var DOCKER_RUN_ARGS_PREFIX = []string{"run", "-d", "--rm"}
View Source
var DOCKER_RUN_ARGS_SUFFIX = []string{"sh", "-c", "trap \"exit 0\" TERM; sleep infinity & wait"}

Functions

func GetContainerIdFromWorkspaceFolder

func GetContainerIdFromWorkspaceFolder(workspaceFolder string) (string, error)

workspaceFolder で指定したディレクトリに対応するコンテナのコンテナ ID を返却する

func GetId

func GetId(psCommandResult string) (string, error)

func Ps

func Ps(filter string) (string, error)

`docker ps --format json` コマンドを実行する。

func Rm

func Rm(containerId string) error

`docker rm -f ${CONTAINER_ID}` コマンドを実行する。

func Run

func Run(args []string, vimFilePath string)

Types

type PsCommandResult

type PsCommandResult struct {
	Id string `json:"ID"`
}

`docker ps --format json` コマンドの実行結果スキーマ

Example:

{
}

func UnmarshalPsCommandResult

func UnmarshalPsCommandResult(data []byte) (PsCommandResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL