https://github.com/bo-yuan-huang/docker-ubuntu-dev
Set up a clean container for Linux using Docker
https://github.com/bo-yuan-huang/docker-ubuntu-dev
development docker ubuntu
Last synced: about 2 months ago
JSON representation
Set up a clean container for Linux using Docker
- Host: GitHub
- URL: https://github.com/bo-yuan-huang/docker-ubuntu-dev
- Owner: Bo-Yuan-Huang
- License: mit
- Created: 2017-08-25T06:36:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-11T03:27:05.000Z (almost 6 years ago)
- Last Synced: 2025-02-16T09:20:25.411Z (over 1 year ago)
- Topics: development, docker, ubuntu
- Language: Shell
- Homepage:
- Size: 1.25 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/Bo-Yuan-Huang/Docker-Ubuntu-Dev)
[](https://app.codacy.com/app/Bo-Yuan-Huang/Docker-VM?utm_source=github.com&utm_medium=referral&utm_content=Bo-Yuan-Huang/Docker-VM&utm_campaign=Badge_Grade_Dashboard)
## 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](base/Dockerfile) is available in Docker host
``` bash
docker pull byhuang/ubuntu-dev:base
```
To create a customized image, modify ``base/Dockerfile`` and build
``` bash
cd base
docker build -t my-image .
```
### Initiate a container
Now you can run a container based on the newly fetched/created image.
``` bash
docker run -it my-image
```
To create a volume (shared storage) and mount to the container.
``` bash
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
``` bash
unminimize # required user input
adduser username # required user input
adduser username sudo # required user input
```
### Personal use example
An example of automating personalization can be found in [user](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](https://github.com/Bash-it/bash-it).
``` bash
# 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)
``` bash
ssh-keygen -R # if duplicated hosts
```
If you want to reconfigure your time zone
``` bash
sudo dpkg-reconfigure tzdata # reconfigure time zone if desired
```
If you want to grant access to files in the volume
``` bash
sudo chmod -R a+rwx /path/to/files # add all permissions to files
```