NOTE: When running this container as
--privilegedon a machine running SELinux in enforcing mode, the container
/sys/fs/selinuxin read-only mode because Ubuntu by default does not understand how to deal with an
SELinux system and SELinux packages/policy/tools would need to be installed in the image to make it work properly.
If this filesystem is not remounted read-only,
aptwill crash, unable to read security contexts.
The problem with doing this on a
--privilegedcontainer: if the host has SELinux mounted read-write, it too will
be remounted read only. After you have finished work with the container, please be sure to remount in read-write mode
on the host operating system.
Published to the Docker Hub as
Ubuntu 14.04 requires no special privileges to run, as opposed some of the systemd containers:
docker run --detach naftulikay/trusty-vm:latest
The container ID will be emitted by Docker and this can be used to execute commands in the Docker container/"VM".
Testing Ansible Roles
To test Ansible roles, pass something of the following to mount your role and execute your tests against it:
When starting the container, a container ID is emitted; this can be saved and used to execute commands within the Docker
docker exec --tty $CONTAINER_ID env TERM=xterm ansible --version docker exec --tty $CONTAINER_ID env TERM=xterm ansible-playbook /path/to/ansible/playbook.yml --syntax-check
This container must do the following:
- :ballot_box_with_check: enable services to be started via the init manager using
service $x start.
/sys/fs/selinux, if present, will be remounted read-only to
allow most programs to work.