Skip to content

Commit

Permalink
rip out OpenShift build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
sosiouxme committed Jul 18, 2017
1 parent cf1603c commit b93ad95
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
29 changes: 0 additions & 29 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,6 @@ To build a container image of `openshift-ansible` using standalone **Docker**:
cd openshift-ansible
docker build -f images/installer/Dockerfile -t openshift-ansible .

### Building on OpenShift

To build an openshift-ansible image using an **OpenShift** [build and image stream](https://docs.openshift.org/latest/architecture/core_concepts/builds_and_image_streams.html) the straightforward command would be:

oc new-build openshift/origin-ansible~https://github.com/openshift/openshift-ansible

However: because the `Dockerfile` for this repository is not in the top level directory, and because we can't change the build context to the `images/installer` path as it would cause the build to fail, the `oc new-app` command above will create a build configuration using the *source to image* strategy. This does build an image successfully, but unfortunately the resulting image will be missing some customizations that are handled by the [Dockerfile](images/installer/Dockerfile) in this repo.

At the time of this writing there is no straightforward option to [set the dockerfilePath](https://docs.openshift.org/latest/dev_guide/builds/build_strategies.html#dockerfile-path) of a `docker` build strategy with `oc new-build`. The alternatives to achieve this are:

- Use the simple `oc new-build` command above to generate the BuildConfig and ImageStream objects, and then manually edit the generated build configuration to change its strategy to `dockerStrategy` and set `dockerfilePath` to `images/installer/Dockerfile`.

- Download and pass the `Dockerfile` to `oc new-build` with the `-D` option:

```
curl -s https://raw.githubusercontent.com/openshift/openshift-ansible/master/images/installer/Dockerfile |
oc new-build -D - \
--docker-image=openshift/origin-ansible \
https://github.com/openshift/openshift-ansible
```

Once a build is started, 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 `oc new-app`:

oc describe imagestream openshift-ansible

## Build the Atomic System Container

A system container runs using runC instead of Docker and it is managed
Expand Down
2 changes: 1 addition & 1 deletion README_CONTAINER_IMAGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Containerized openshift-ansible to run playbooks

The [Dockerfile](images/installer/Dockerfile) in this repository uses the [Centos:7](https://hub.docker.com/_/centos/) 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.
The [Dockerfile](images/installer/Dockerfile) in this repository can be used to build a containerized `openshift-ansible`. The resulting image can run any of the provided playbooks. See [BUILD.md](BUILD.md) for image build instructions.

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).

Expand Down

0 comments on commit b93ad95

Please sign in to comment.