Skip to content

ashenm/workspace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workspace

USAGE

Using script/workspace

./script/workspace [OPTION...] [DIRECTORY...]
Option Description

-h

--help

Print usage instructions

--hostname

Assign custom container hostname

--image

Override container images (default 'ashenm/workspace:latest')

-n

--name

Assign custom container name

--blank

Avoid all extended customisations

--no-agent

Avoid all extended customisations

--no-git

Avoid ~/.gitconfig read-only bind mount

--no-gpg

Avoid ~/.gnupg bind mount

--no-host

Avoid population of host IP mapping

--no-mount

Avoid directory mount

--no-publish

Avoid container’s 8080, 8081 and 8082 ports exposition to the host

--no-ssh

Avoid ~/.ssh read-only bind mount

--no-rm

Avoid automatic removal of container on exit

Directory Mounts
workspace [DIRECTORY]

The arguments to workspace can be used to bind mount a host directory, current directory will be assumed unless specified, to a new container either using a relative or an absolute path. It will be binded at ~/workspace on the created container.

For instance, to bind current directory run ./workspace . or simply ./workspace.

Similarly, to bind a directory like C:\foo\bar using an absolute path on a Windows* system to container’s ~/workspace run ./workspace C:\foo\bar.

workspace [DIRECTORY…​]

The provision of multiple directory paths, absolute or relative, will bind all specified directories onto the container’s ~/workspace bearing respective sub-directory names.

For instance, the command ./workspace foo bar will bind the directories foo and bar within current working directory onto container’s ~/workspace/foo and ~/workspace/bar respectively.

workspace --no-mount

The present of flag --no-mount will preclude the attempt to bind any directories onto container’s ~/workspace directory.

SSH Agent Sharing
workspace [--no-agent] [DIRECTORY]

The present of flag --no-agent will preclude the attempt to bind ssh-agent socket onto container with read-only access.

Git Configuration
workspace [--no-git] [DIRECTORY]

The present of flag --no-git will preclude the attempt to bind ~/.gitconfig on host to ~/.gitconfig on the container with read-only access.

OpenPGP Keyring
workspace [--no-gpg] [DIRECTORY]

The present of flag --no-gpg will preclude the attempt to bind ~/.gnupg on host to ~/.gnupg on the container with read-write access.

Host IP Mapping
workspace [--no-host] [DIRECTORY]

The present of flag --no-host will preclude the attempt to populate the docker0 gateway alias entry.

Container Port Publishing
workspace [--no-publish] [DIRECTORY]

The present of flag --no-publish will preclude the attempt to expose container’s ports 8080, 8081, and 8082 to host.

SSH Configuration
workspace [--no-ssh] [DIRECTORY]

The present of flag --no-ssh will preclude the attempt to bind ~/.ssh on host to ~/.ssh on the container with read-only access.

Automatic Container Removal
workspace [--no-rm] [DIRECTORY]

The present of flag --no-rm will preclude the attempt to automatically remove container upon exit.

Custom Container Image
workspace [--image=IMAGE] [DIRECTORY]

The workspace can be used to run any docker image that is not intended to be run as an executable. By default, it will attempt to use ashenm/workspace:latest as the image unless specified.

The default image can be overridden by simply specifying the desired image name via option --image. If multiple images are specified the last most image name will be used.

For instance, to bind current directory within alpine:latest run ./workspace --image alpine:latest.

Custom Container Hostname
workspace [--hostname=HOSTNAME] [DIRECTORY]

The default container hostname, reflecting container’s ID, can be overridden using the option --hostname.

For instance, to override container hostname to workspace.ashenm.ml, run ./workspace --hostanme 'workspace.ashenm.ml' [DIRECTORY].

Custom Container Name
workspace [--name=NAME] [DIRECTORY]

The default generated container name can be overridden using the option --name (short option -n). For instance, to assign name example as the container name, run ./workspace --name 'example' [DIRECTORY].

Using docker run

COMPATIBILITY

Windows

UNIX Permissions

The Docker Desktop currently uses SMB/CIFS for host volumes and therefore does not support multiple users nor different file permissions on host mounts.

A mundane solution would be to use Docker Volumes which are independent of the directory structure of the host machine. The volume/workspace.cmd facilitate ease administration of Docker Volumes allowing creation, backup, upload, and deletion.

workspace create

Creates a new Docker Volume named workspace that containers can consume and store data in.

workspace backup

Creates a gzip tarball in the current working directory from the files stored in Docker Volume workspace.

workspace push

Clones current working directory into the Docker Volume workspace.

workspace delete

Removes Docker Volume workspace.

workspace update

Updates facilitator scripts to the latest

scripts

Given that Docker is installed, the facilitator scripts provided can be used with any shell that is is Bourne SHell compatible.

For Microsoft Windows use a POSIX-compliant run-time environment such as MSYS or Cygwin with WinPTY or Microsoft’s own Windows Subsystem for Linux.