Sign inSign up

byhuang/ubuntu-dev

By byhuang

•Updated about 6 years ago

Image
0

443

byhuang/ubuntu-dev repository overview

Build Status Codacy Badge

⁠About

This repo demonstrates the use of Docker to efficiently create, run, and deploy a Linux (Ubuntu Bionic) image with several basic build packages. It also provides scripts to build customized Docker image for personal configuration, e.g., vim, bash, git, etc.

⁠Get the Ubuntu Bionic image with development packages installed

A pre-built image with packages listed in Dockerfile⁠ is available in Docker host

docker pull byhuang/ubuntu-dev:base

To create a customized image, modify base/Dockerfile and build

cd base
docker build -t my-image .
⁠Initiate a container

Now you can run a container based on the newly fetched/created image.

docker run -it my-image

To create a volume (shared storage) and mount to the container.

docker volume build my-data
docker run -it \                                # interactive pseudo TTY
           -v my-data:/path/to/dir \            # mount the volume (shared storage)
           --name cont-name \                   # specify container name
           --cap-add=SYS_PTRACE \               # enable debugger
           --security-opt seccomp=unconfined \  # enable debugger
           --privileged \                       # enable docker in docker
           my-image                             # image

By default, Ubuntu Docker image does not have packages required for user log-in installed. You can enable such features by running unminimize before logging in as a user. To leave the container running in background by pressing the hot keys

unminimize                                      # required user input
adduser username                                # required user input
adduser username sudo                           # required user input
<C-p> <C-q>
⁠Personal use example

An example of automating personalization can be found in user⁠. It shows how to create an user account (with sudo) and set up personal preferred environment. To install customized bash prompt based on bash_it⁠.

# root
passwd byhuang                                  # set pass word

# log-in as user
.themes/install.sh                              # initiate bash config
⁠Notes

If you have duplicated hosts (IP being used before)

ssh-keygen -R <host>                            # if duplicated hosts

If you want to reconfigure your time zone

sudo dpkg-reconfigure tzdata                    # reconfigure time zone if desired

If you want to grant access to files in the volume

sudo chmod -R a+rwx /path/to/files              # add all permissions to files

Tag summary

Content type

Image

Digest

Size

438.8 MB

Last updated

about 6 years ago

docker pull byhuang/ubuntu-dev