Git Product home page Git Product logo

base-container-template's Introduction

base-container-template

Ubuntu 18.04 container template with RDP and VNC enabled which can be extended for more specialised applications.

This is a modified version of the container created by consol (https://hub.docker.com/r/consol/ubuntu-xfce-vnc/).

Usage

The container can be run by both root and a user with a non-root UID and GID.

Credentials

A default user has been created with the credentials default:default.
Username: default
Password: default
The default user has passwordless sudo priviledges.

To run this container using Python 3, the following script can be used:

import docker

client = docker.from_env()
groups = [100] # Needed as this group allows for sudo access
image = 'aicampbell/vnc-ubuntu18-xfce'
volume = {"/host/path/to/nfs/directory" : {"bind": "/container/path/to/nfs/directory", "mode": "rw"}, # NFS - this is acting as the data directory which is stored on NFS
}
user = '<UID of user>:<GID of user>' # Needed for read/write permissions using NFS

client.containers.run(image=image, detach=True, publish_all_ports=True, volumes=volume, user=user, group_add=groups)

Accessing the container using VNC/RDP viewer

Once the container has been created, a VNC/RDP client can be used to test or use the container. To see the open ports, use the command

sudo docker ps -a

Example ouput: PORTS 0.0.0.0:32901->3389/tcp, 0.0.0.0:32900->5901/tcp, 0.0.0.0:32899->6901/tcp

RDP

Using an RDP client, use the port which maps to 3389. From the example above, use 0.0.0.0:32901

VNC

Using a VNC client, use the port which maps to 5901. From the example above, use 0.0.0.0:32900 The vnc password is: vncpassword

NoVNC

Using a NoVNC client, use the port which maps to 6901. From the example above, use 0.0.0.0:32899 The vnc password is: vncpassword

base-container-template's People

Contributors

aicampbell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

base-container-template's Issues

duplicated entries in /etc/passwd

This command
echo "default:x:$(id -u):$(id -g):,,,:/headless:/bin/bash" >> /etc/passwd
in vnc_startup.sh creates an entry for user default.
If we use "docker commit" to generate a new image and run from it, it will complain:
duplicated entries in /etc/passwd and fail to boot.

Root cause:
When we use "commit", the passwd file will be saved in which there is already a line for "default". On next run, it'll append a duplicated one, thus causing error in following commands.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.