Skip to content

Instantly share code, notes, and snippets.

@rafabene
Created December 23, 2015 17:02
Show Gist options
  • Save rafabene/7d8f5e046aca2a86bd71 to your computer and use it in GitHub Desktop.
Save rafabene/7d8f5e046aca2a86bd71 to your computer and use it in GitHub Desktop.
Docker swarm build and push
$ docker-compose --x-networking up -d
WARNING:
"wildfly" defines links, which are not compatible with Docker networking and will be ignored.
Future versions of Docker will not support links - you should remove them for forwards-compatibility.
Pulling modcluster (rafabene/mod_cluster:latest)...
aws-swarm-master: Pulling rafabene/mod_cluster:latest... : downloaded
aws-swarm-node-01: Pulling rafabene/mod_cluster:latest... : downloaded
aws-swarm-node-02: Pulling rafabene/mod_cluster:latest... : downloaded
Creating modcluster
Pulling db (postgres:latest)...
aws-swarm-node-02: Pulling postgres:latest... : downloaded
aws-swarm-master: Pulling postgres:latest... : downloaded
aws-swarm-node-01: Pulling postgres:latest... : downloaded
Creating db
Building wildfly
Step 1 : FROM rafabene/wildfly-admin
latest: Pulling from rafabene/wildfly-admin
a2c33fe967de: Pulling fs layer
4d1ec7e2b1dd: Pull complete
7ed0005a64f9: Pull complete
92009d6c8aff: Pull complete
e3ff94cddd8b: Pull complete
e5351df2706d: Pull complete
88389be452f6: Pull complete
722c8bdf4d33: Pull complete
481c174e3d0d: Pull complete
3b4e1d18fb41: Pull complete
1681ffdbbe50: Pull complete
bda081e220a9: Pull complete
52940fa06773: Pull complete
c2b3c0dc1c5f: Pull complete
672cb4fbe2f4: Pull complete
c5540c6aa0e6: Pull complete
187008adb305: Pull complete
99d33d19b265: Pull complete
2504abaf5830: Pull complete
055df3a0bc09: Pull complete
491b0aec9e3e: Pull complete
6eba448ad34b: Pull complete
a709af04ccdb: Pull complete
b21c92d352bb: Pull complete
a3b71f66edc1: Pull complete
d0cd5ab0ddbe: Pull complete
b96585cf5110: Pull complete
Digest: sha256:330087a2e1eac5103df0680f34c3fa17677efa7c8050ff51da49423a63a184c4
Status: Downloaded newer image for rafabene/wildfly-admin:latest
---> b96585cf5110
Step 2 : MAINTAINER "Rafael Benevides" <[email protected]>
---> Running in 1af4e4ee4006
---> ca488a16fd6d
Removing intermediate container 1af4e4ee4006
Step 3 : COPY customization /opt/jboss/wildfly/customization/
---> beb244d7d631
Removing intermediate container fab0b8786c11
Step 4 : USER root
---> Running in b075d11cee28
---> 63eb9239be78
Removing intermediate container b075d11cee28
Step 5 : RUN chmod +x /opt/jboss/wildfly/customization/execute.sh
---> Running in b72ccfd2f785
---> 57047567801d
Removing intermediate container b72ccfd2f785
Step 6 : RUN /opt/jboss/wildfly/customization/execute.sh standalone standalone-ha.xml
---> Running in c4a4fdaef51d
=> Starting WildFly server
=> Waiting for the server to boot
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
=> Executing the commands
The batch executed successfully
process-state: reload-required
=> Shutting down WildFly
{"outcome" => "success"}
---> 9daf59d4cfa0
Removing intermediate container c4a4fdaef51d
Step 7 : ADD ticket-monster.war /opt/jboss/wildfly/standalone/deployments/
---> 29bf780174b3
Removing intermediate container 48e595ec05d2
Step 8 : RUN rm -rf /opt/jboss/wildfly/standalone/configuration/standalone_xml_history
---> Running in aebc1e3ee6c1
---> e127e479484c
Removing intermediate container aebc1e3ee6c1
Step 9 : RUN chown -R jboss:jboss /opt/jboss/wildfly/
---> Running in 2ab12aa3b188
---> ef7249acbb30
Removing intermediate container 2ab12aa3b188
Step 10 : USER jboss
---> Running in 4a22de275627
---> 606c68d109bd
Removing intermediate container 4a22de275627
Step 11 : EXPOSE 8080 9990 8009
---> Running in 7f5900c60e68
---> 06cd1b7d8073
Removing intermediate container 7f5900c60e68
Step 12 : CMD /opt/jboss/wildfly/bin/standalone.sh -b `hostname -i` -bmanagement `hostname -i` -c standalone-ha.xml
---> Running in bde421210f74
---> 6b2dc12dcbfe
Removing intermediate container bde421210f74
Successfully built 6b2dc12dcbfe
Creating swarm_wildfly_1
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
swarm_wildfly latest 6b2dc12dcbfe 32 seconds ago 763 MB
rafabene/mod_cluster latest 1ae1d20b2825 2 hours ago 355.5 MB
rafabene/wildfly-admin latest b96585cf5110 3 hours ago 584.5 MB
swarm latest a9975e2cc0a3 13 days ago 17.15 MB
postgres latest b305a133422a 2 weeks ago 265.1 MB
$ docker tag swarm_wildfly rafabene/swarm_wildfly-pushed
$ docker push rafabene/swarm_wildfly-pushed
The push refers to a repository [docker.io/rafabene/swarm_wildfly-pushed] (len: 1)
6b2dc12dcbfe: Pushed
06cd1b7d8073: Pushed
606c68d109bd: Pushed
ef7249acbb30: Pushed
e127e479484c: Pushed
29bf780174b3: Pushed
9daf59d4cfa0: Pushed
57047567801d: Pushed
63eb9239be78: Pushed
beb244d7d631: Pushed
ca488a16fd6d: Pushed
a3b71f66edc1: Pushed
187008adb305: Pushed
1681ffdbbe50: Pushed
e5351df2706d: Pushed
e3ff94cddd8b: Pushed
4d1ec7e2b1dd: Pushed
latest: digest: sha256:ccff882081e0644db079920847d4cd1a8152276990cda725c7d780b1e121b66b size: 80527
Image pushed to hub.docker.com: https://hub.docker.com/r/rafabene/swarm_wildfly-pushed/
db:
container_name: "db"
image: postgres
net: "my-swarm-network"
ports:
- "5432:5432"
environment:
- POSTGRES_USER=ticketmonster
- POSTGRES_PASSWORD=ticketmonster-docker
modcluster:
container_name: "modcluster"
image: rafabene/mod_cluster
net: "my-swarm-network"
ports:
- "80:80"
wildfly:
#image: rafabene/wildfly-ticketmonster
build: ../Dockerfiles/ticketmonster/
net: "my-swarm-network"
#Links forces the order of execution: https://github.com/docker/compose/issues/374
links:
- db:db
- modcluster:modcluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment