Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s2i-liberty #4

Merged
merged 42 commits into from
Oct 14, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1d45bab
s2i-liberty initial commit
raffaelespazzoli Sep 27, 2016
3cef661
fixed repo
raffaelespazzoli Sep 27, 2016
04fa257
added readme
raffaelespazzoli Sep 28, 2016
dfc8d5a
deleted test directory
raffaelespazzoli Sep 28, 2016
ea42cbc
fixed missing bashang in run command
raffaelespazzoli Sep 28, 2016
97d40b5
Update readme.md
raffaelespazzoli Sep 30, 2016
12666fa
Update readme.md
raffaelespazzoli Sep 30, 2016
23bf58a
added two build approach
raffaelespazzoli Oct 6, 2016
6da266e
added ability to debug liberty
raffaelespazzoli Oct 6, 2016
923ac20
added echo statements to build
raffaelespazzoli Oct 6, 2016
5f74db7
debug port
raffaelespazzoli Oct 6, 2016
64325ec
a
raffaelespazzoli Oct 6, 2016
cb019e4
d
raffaelespazzoli Oct 6, 2016
e2bc269
d
raffaelespazzoli Oct 6, 2016
b073470
d
raffaelespazzoli Oct 6, 2016
c5e6088
jolokia
raffaelespazzoli Oct 7, 2016
17015a7
improved jolokia
raffaelespazzoli Oct 7, 2016
5811643
run debug
raffaelespazzoli Oct 7, 2016
1ea2747
debug run
raffaelespazzoli Oct 7, 2016
7970be5
run debug
raffaelespazzoli Oct 7, 2016
86ad4bf
debug run
raffaelespazzoli Oct 7, 2016
3060150
debug jolokia
raffaelespazzoli Oct 7, 2016
5deb6e3
jolokia debug
raffaelespazzoli Oct 7, 2016
fbf5906
jolokia debug
raffaelespazzoli Oct 7, 2016
2ae50b8
Merge branch 'master' of
raffaelespazzoli Oct 7, 2016
d5560c3
jolokia debug
raffaelespazzoli Oct 7, 2016
a416fb4
jolokia debug
raffaelespazzoli Oct 7, 2016
8d34e3f
jolokia debug
raffaelespazzoli Oct 7, 2016
24e192c
jolokia debug
raffaelespazzoli Oct 7, 2016
2ec145d
jolokia debug
raffaelespazzoli Oct 7, 2016
57f9d58
no jolokia
raffaelespazzoli Oct 8, 2016
13c05c5
improved cohexistance of chained builds and extended build
raffaelespazzoli Oct 8, 2016
e7500dd
debug
raffaelespazzoli Oct 8, 2016
fd7e11d
debug
raffaelespazzoli Oct 8, 2016
67a4a38
fixed readme
raffaelespazzoli Oct 8, 2016
a4cf45d
readme fixes
raffaelespazzoli Oct 8, 2016
ed21fdb
d
raffaelespazzoli Oct 8, 2016
7dacd1e
last fix
raffaelespazzoli Oct 8, 2016
2a0cb63
correction for allowing a random user in root group to run the image
raffaelespazzoli Oct 10, 2016
909ec16
added application verification
raffaelespazzoli Oct 11, 2016
e29a787
fixed the md
raffaelespazzoli Oct 11, 2016
11863f1
fix
raffaelespazzoli Oct 11, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
readme fixes
  • Loading branch information
raffaelespazzoli committed Oct 8, 2016
commit a4cf45dfe14a65a29fd9172a13d943cbe259235e
4 changes: 4 additions & 0 deletions s2i-liberty/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
chown -R 1001:0 /opt/ibm/wlp/usr/servers/defaultServer && \
chown -R 1001:0 /opt/ibm/wlp/output && \
chown -R 1001:0 /logs && \
mkdir -p $WORKDIR/artifacts && \
mkdir -p $WORKDIR/config && \
chown -R 1001:0 $WORKDIR && \
ln $STI_SCRIPTS_PATH/assemble-runtime $STI_SCRIPTS_PATH/assemble

COPY ./placeholder.txt $WORKDIR/artifacts
COPY ./placeholder.txt $WORKDIR/config

WORKDIR $WORKDIR

Expand Down
45 changes: 33 additions & 12 deletions s2i-liberty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ Let's break down the command in further detail

A new image called *s2i-liberty* was produced and can be used to build Liberty applications in the subsequent sections.

wait for the build to complete, type:
```
oc logs -f bc/s2i-liberty
```

#### Create the first s2i build

The first s2i build will create the artifact. For this buld we will use the `jboss-eap-7/eap70-openshift` which is capable of building a maven project.
Expand Down Expand Up @@ -176,6 +181,11 @@ Let's break down the command in further detail

A new image called *s2i-liberty* was produced and can be used to build Liberty applications in the subsequent sections.

wait for the build to complete, type:
```
oc logs -f bc/s2i-liberty
```

#### Create the build config

In order to use the extended s2i process we need to configure the build config with some additional pieces of information. There does not appear to be a way to do this directly from the command line so we will use a two-phase approach.
Expand All @@ -187,18 +197,23 @@ oc new-build --docker-image=registry.access.redhat.com/jboss-eap-7/eap70-openshi
Second modify the newly created build config with the following patch command:
```
oc patch bc hello-world -p '
strategy:
type: Source
sourceStrategy:
from:
kind: ImageStreamTag
name: 'eap70-openshift:latest'
runtimeImage:
kind: ImageStreamTag
name: 's2i-liberty:latest'
runtimeArtifacts:
- sourcePath: /opt/eap/standalone/deployments/hello-world-war-1.0.0.war
destinationDir: artifact
"spec": {
"strategy": {
"sourceStrategy": {
"runtimeImage": {
"kind": "ImageStreamTag",
"name": "s2i-liberty:latest"
},
"runtimeArtifacts": [
{
"sourcePath": "/opt/eap/standalone/deployments/hello-world-war-1.0.0.war",
"destinationDir": "artifacts"
}
]
}
}
}

'
```
notice that the source strategy has two additional sections:
Expand All @@ -213,6 +228,12 @@ The liberty runtime image expects:

As you can notice the runtimeArtifacts section mentions files by name. This implies that for this process to work the artifact created by the builder image have to be always the same. I expect improvements on this front in future releases of OpenShigt but for now this is a constraint that must be kept in mind.

restart the build and wait for it to finish:

```
oc start-build -F hello-world
```

### Create a new Application

To demonstrate the usage of the newly created builder and runtime images, a JEE example application will be built and deployed to Liberty using the Source to Image process.
Expand Down