Skip to content

Commit

Permalink
Move container build instructions to BUILD.md
Browse files Browse the repository at this point in the history
  • Loading branch information
codificat committed Apr 24, 2017
1 parent f6c853f commit fcc1ef6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
26 changes: 22 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# openshift-ansible RPM Build instructions
# openshift-ansible build instructions

## Build openshift-ansible RPMs

We use tito to make building and tracking revisions easy.

For more information on tito, please see the [Tito home page](https://github.com/dgoodwin/tito "Tito home page").


## Build openshift-ansible

- Change into openshift-ansible
```
cd openshift-ansible
Expand All @@ -24,3 +23,22 @@ tito tag
```
tito build --rpm
```

## Build an openshift-ansible container image

To build a container image of `openshift-ansible` using standalone **Docker**:

cd openshift-ansible
docker build -t openshift/openshift-ansible .

Alternatively this can be built using on **OpenShift** using a [build and image stream](https://docs.openshift.org/latest/architecture/core_concepts/builds_and_image_streams.html) with this command:

oc new-build docker.io/aweiteka/playbook2image~https://github.com/openshift/openshift-ansible

The progress of the build can be monitored with:

oc logs -f bc/openshift-ansible

Once built, the image will be visible in the Image Stream created by the same command:

oc describe imagestream openshift-ansible
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ These are plugins used in playbooks and roles:
└── test Contains tests.
```

## Building RPMs
## Building openshift-ansible RPMs and container images

See the [RPM build instructions](BUILD.md).
See the [build instructions in BUILD.md](BUILD.md).

## Running tests

Expand Down
17 changes: 2 additions & 15 deletions README_CONTAINER_IMAGE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
# Containerized openshift-ansible to run playbooks

The [Dockerfile](Dockerfile) in this repository uses the [playbook2image](https://github.com/aweiteka/playbook2image) source-to-image base image to containerize `openshift-ansible`. The resulting image can run any of the provided playbooks.
The [Dockerfile](Dockerfile) in this repository uses the [playbook2image](https://github.com/aweiteka/playbook2image) source-to-image base image to containerize `openshift-ansible`. The resulting image can run any of the provided playbooks. See [BUILD.md](BUILD.md) for image build instructions.

**Note**: at this time there are known issues that prevent to run this image for installation/upgrade purposes (i.e. run one of the config/upgrade playbooks) from within one of the hosts that is also an installation target at the same time: if the playbook you want to run attempts to manage the docker daemon and restart it (like install/upgrade playbooks do) this would kill the container itself during its operation.

## Build

To build a container image of `openshift-ansible`:

1. Using standalone **Docker**:

cd openshift-ansible
docker build -t openshift/openshift-ansible .
The image is designed to **run as a non-root user**. The container's UID is mapped to the username `default` at runtime. Therefore, the container's environment reflects that user's settings, and the configuration should match that. For example `$HOME` is `/opt/app-root/src`, so ssh keys are expected to be under `/opt/app-root/src/.ssh`. If you ran a container as `root` you would have to adjust the container's configuration accordingly, e.g. by placing ssh keys under `/root/.ssh` instead. Nevertheless, the expectation is that containers will be run as non-root; for example, this container image can be run inside OpenShift under the default `restricted` [security context constraint](https://docs.openshift.org/latest/architecture/additional_concepts/authorization.html#security-context-constraints).

1. Using an **OpenShift** build:

oc new-build docker.io/aweiteka/playbook2image~https://github.com/openshift/openshift-ansible
oc describe imagestream openshift-ansible
**Note**: at this time there are known issues that prevent to run this image for installation/upgrade purposes (i.e. run one of the config/upgrade playbooks) from within one of the hosts that is also an installation target at the same time: if the playbook you want to run attempts to manage the docker daemon and restart it (like install/upgrade playbooks do) this would kill the container itself during its operation.

## Usage

Expand Down

0 comments on commit fcc1ef6

Please sign in to comment.