Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfaulhab committed Feb 10, 2016
1 parent 101f267 commit 1f74e4e
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
*.zip
24 changes: 24 additions & 0 deletions jboss-docker-basics/01-jboss-eap/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Set the base image to Fedora
FROM jboss/base-jdk:7

### File Author / Maintainer
MAINTAINER "Sebastian Faulhaber" "[email protected]"

### Install EAP 6.4.0
COPY installs/jboss-eap-6.4.0.zip /tmp/jboss-eap-6.4.0.zip
RUN unzip /tmp/jboss-eap-6.4.0.zip

### Set Environment
ENV JBOSS_HOME /opt/jboss/jboss-eap-6.4

### Create EAP User
RUN $JBOSS_HOME/bin/add-user.sh admin admin123! --silent

### Configure EAP
RUN echo "JAVA_OPTS=\"\$JAVA_OPTS -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0\"" >> $JBOSS_HOME/bin/standalone.conf

### Open Ports
EXPOSE 8080 9990 9999

### Start EAP
ENTRYPOINT $JBOSS_HOME/bin/standalone.sh -c standalone-full-ha.xml
1 change: 1 addition & 0 deletions jboss-docker-basics/01-jboss-eap/installs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Download the JBoss Enterprise Application Platform (EAP) distribution (`jboss-eap-6.4.0.zip`) from Red Hat Customer Portal (https://access.redhat.com/jbossnetwork/restricted/softwareDetail.html?softwareId=37393&product=appplatform&version=6.4&downloadType=distributions) and place it into this folder.
8 changes: 8 additions & 0 deletions jboss-docker-basics/02-jboss-eap-with-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Set the base image to the one built before
FROM sfaulhab/jboss-eap-6.4

### File Author / Maintainer
MAINTAINER "Sebastian Faulhaber" "[email protected]"

### Add application to JBoss EAP
COPY app/jboss-as-helloworld.war $JBOSS_HOME/standalone/deployments/
Binary file not shown.
71 changes: 71 additions & 0 deletions jboss-docker-basics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 1. Docker basics
```
# Run DOCKER hello-world container
# 1. Explain pull mechanism
# 2. Highlight container output
docker run hello-world
# Show the pulled image / explain registry
docker images
# Show "hello-world" a second time (it runs damn fast now!)
docker run hello-world
# Demonstrate an interactive container based on ubuntu
docker run -it ubuntu bash
# Show that we're actually running Ubuntu on a RHEL guest
cat /etc/*-release
```

# 2. Run JBoss Enterprise Application Platform (EAP) within a Docker container

```
# Walk through Dockerfile
# Build the image
docker build --rm -t sfaulhab/jboss-eap-6.4 01-jboss-eap
# Show the image in Docker registry
docker images
# Run the container
docker run -d -P sfaulhab/jboss-eap-6.4
# Show information about running container (get external port)
docker ps | grep sfaulhab
# Connect into running container
docker exec -ti <container-id> /bin/bash
# Open browser and login to JBoss EAP console
# Stop container
docker stop <container-id>
```


# 3. Run JBoss Enterprise Application Platform (EAP) incl. custom application

```
# Walk through Dockerfile
# Build the image
docker build --rm -t sfaulhab/jboss-eap-helloworld 02-jboss-eap-with-app
# Show the image in Docker registry
docker images
# Run the container
docker run -d -P sfaulhab/jboss-eap-helloworld
# Show information about running container (get external port)
docker ps | grep sfaulhab
# Open browser and login to JBoss EAP console: http://localhost:32785/jboss-as-helloworld/
# Stop container
docker stop <container-id>
```
5 changes: 5 additions & 0 deletions jboss-docker-basics/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# Cleanup old images
docker rmi -f docker.io/hello-world
docker rmi -f sfaulhab/jboss-eap-6.4
docker rmi -f sfaulhab/jboss-eap-helloworld

0 comments on commit 1f74e4e

Please sign in to comment.