Applications composed of small, independenly deployable services communicatingÂ
over the network, usually with HTTP, transferring data/state between them, usually with JSON.
Â
Origin is the upstream community project that powers OpenShift. Built around a core of Docker container packaging and Kubernetes container cluster management, Origin is also augmented by application lifecycle management functionality and DevOps tooling. Origin provides a complete open source container application platform.
# Start minishift
# Lots of output while minishift
# downloads docker images
$ minishift start --vm-driver=virtualbox
# Set local paths
$ eval $(minishift oc-env)
# Ensure oc is using minishift
$ oc config use-context minishift
# Open the web console
$ minishift console
# The parent image uses ONBUILD command
# to add package.json, run npm install and
# ultimately run the application
FROM bucharestgold/centos7-nodejs:7.10.0
# Set environment variables available
# in the runtime container
ENV ZIPKIN_SERVER_URL="http://zipkin"
ONBUILD COPY package.json /opt/app-root/src
ONBUILD COPY . /opt/app-root/src
# Drop the root user and make the content of
# /opt/app-root owned by user 1001
# Do this after we've copied the local directory
# to avoid UID conflicts
ONBUILD RUN chown -R 1001:0 /opt/app-root && chmod -R ug+rwx /opt/app-root
ONBUILD USER 1001
# Install the app
ONBUILD RUN npm -s install
CMD ["/bin/bash", "-c", "npm run -d $NPM_RUN" ]
$ oc new-project bonjour-tout-le-monde
$ oc new-build --binary --name=bonjour -l app=bonjour
$ oc start-build bonjour --from-dir=. --follow
$ oc new-app bonjour -l app=bonjour
$ oc expose service bonjour
$ oc new-build \
--image-stream=centos7-s2i-nodejs:latest \
--binary --name=hola -l app=hola
$ oc start-build hola --from-dir=. --follow
$ oc new-app hola -l app=hola
$ oc expose-service hola
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "centos7-s2i-nodejs",
"creationTimestamp": "2017-05-07T00:55:49.860Z"
},
"spec": {
"tags": [
{
"name": "4.8.3",
"annotations": {
"description": "Build and run Node.js applications",
"iconClass": "icon-nodejs",
"tags": "builder, node, nodejs, nodejs-7.10.0, nodejs-7.10.0",
"supports": "nodejs:7, nodejs:7.10, nodejs",
"sampleRepo": "https://github.com/bucharest-gold/s2i-nodejs.git"
},
"from": {
"kind": "DockerImage",
"name": "bucharestgold/centos7-s2i-nodejs:7.10.0"
}
}
]
}
}
Lance Ball
Sr. Software Engineer
Red Hat
http://lanceball.com/riviera-dev-2017
@lanceball  / @lance