Created
April 24, 2018 20:52
-
-
Save hodrigohamalho/83a2d88ee0e857c6d876223dcf40b8ac to your computer and use it in GitHub Desktop.
NodeJS Nginx Chained Build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| oc create -f https://github.com/sclorg/s2i-nodejs-container/blob/master/imagestreams/nodejs-rhel7.json -n openshift | |
| oc new-project app-nodejs | |
| oc new-build nodejs:8~https://github.com/hodrigohamalho/sal-frontend --name=sal-frontend-s2i | |
| oc new-build --name=sal-frontend-nginx \ | |
| --docker-image=registry.access.redhat.com/rhscl/nginx-112-rhel7 \ | |
| --source-image=sal-frontend-s2i \ | |
| --source-image-path=/opt/app-root/src/dist/:. \ | |
| --dockerfile=$'FROM rhscl/nginx-112-rhel7\nCOPY dist /opt/app-root/src\nCMD ["nginx", "-g", "daemon off;"]' | |
| oc new-app sal-frontend-nginx --name=sal-frontend | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @hodrigohamalho
I managed to achive the same goal on step #2 but with no need to use the inline Dockerfile...
See how:
the trick is on
--source-image-pathif you pass/.at the end of the source path it copies the only content of thedist/dir...