[JAVA] I tried using Wercker to create and publish a Docker image that launches GlassFish 5.

Use Wercker to create a Docker image of an environment running GlassFish5 on CentOS.

Description

Wercker is a Docker-based CI / CD automation platform.

GlassFish 5 is an application server that is a reference implementation of Java EE 8. Currently, development is underway for the official release, and it has been built and released as a beta version.

I explained below about creating an image of this GlassFish 5 environment built on Docker:

-I made a Dockerfile to start Glassfish 5 using Oracle Java

In the above, the procedure for creating a Docker image is defined in the Dockerfile, and the Docker image is created and published by the Automated Build of Docker Hub.

This time, we will use Wercker to define the procedure for creating a Docker image and publish it to Docker Hub.

Also, in the previous procedure, it was a combination of Oracke Java and Oracle Linux, but this time it will be an environment using CentOS and OpenJDK.

Operation image

Environmental information to be built

Premise

Owning the following accounts:

procedure

1. Get the repository published on GitHub

2. Edit wercker.xml

Change the following part of wercker.xml to your own information.

--USERNAME: DockerHub account name --PASSWORD: DockerHub password --DOCKER_IMAGE_NAME: Image name to publish --DOCKER_IMAGE_TAG: Tags attached to images to be published --DOCKER_IMAGE'S_AUTHOR_NAME: Creator information

- internal/docker-push:
     username: [USERNAME]
     password: [PASSWORD]
     repository: [DOCKER_IMAGE_NAME]
     tag: [DOCKER_IMAGE_TAG]
     author: [DOCKER_IMAGE'S_AUTHOR_NAME]
     cmd: /bin/bash --login

This information can also be set in Wercker as an environment variable without having to write it directly in wercker.xml.

3. Definition of Wercker Application

3.1. Create Application

Select "Create"-> "Application" from the menu at the top of the screen

3.2. Repository settings

Select GitHub or Bitbucket and select the Wercker application repository you manage there.

With it selected, click Use selected repo.

3.3. Access method settings

Leave the default (do not use the SSH key) and click Next Step.

3.4. Public / Private selection

Select whether to make the Wercker application defined here publicly available or private. If you want to publish it, select "Make my app public".

3.5. Build

After transitioning to the Build tab screen, click "Trigger a build now" at the bottom of the screen.

3.6. Definition of environment variables

If you used environment variables in step 2, define them on the ** Environment ** tab. Information that you do not want to disclose, such as passwords, can be hidden.

3.7. Check the build status

You can check the build status in real time with the Build tag.

4. Obtaining and using images from Docker Hub

If the build is successful with Wercker, it will be published to DockerHub with the defined image name. From here, do docker pull to use the image.

5. Start the Docker container

The Docker Hub image I publish launches like this:

docker run -it --rm -p 4848:4848 -p 8080:8080 shinyay/centos7-openjdk8-glassfish5

When you start it, the startup shell ** start-domain.sh ** is placed in the directory immediately after it is started to simplify the startup of GlassFish 5. Doing this launches the default domain (domain1).

[root@4e1fb53e79af ~]# ls
anaconda-ks.cfg  start-domain.sh

[root@4e1fb53e79af ~]# ./start-domain.sh

I will check the startup

[root@4e1fb53e79af ~]# asadmin list-domains
domain1 running
Command list-domains executed successfully.

Public repository

Summary

This time, we are using a single pipeline without considering the workflow. In that pipeline, we even build and publish images. I'm thinking of making this a separate pipeline and creating a pipeline that creates and publishes images of different versions and environments in parallel.

Recommended Posts

I tried using Wercker to create and publish a Docker image that launches GlassFish 5.
I tried to create a padrino development environment with Docker
[Rails 6.0, Docker] I tried to summarize the Docker environment construction and commands necessary to create a portfolio
I tried to integrate Docker and Maven / Netbean nicely using Jib
Use Jenkins to build inside Docker and then create a Docker image.
A shell script that builds a Docker image and pushes it to ECR
I tried to verify AdoptOpenJDK 11 (11.0.2) with Docker image
I tried to create a LINE clone app
I tried to implement a server using Netty
I tried to create a portfolio with AWS, Docker, CircleCI, Laravel [with reference link]
[Introduction to Docker] Create a Docker image for machine learning and use Jupyter notebook
Create a docker image that runs a simple Java app
I tried to create a Clova skill in Java
I tried to build an environment using Docker (beginner)
I tried to create a shopping site administrator function / screen with Java and Spring
I tried to create a Ruby gem that outputs json output of book search results using Google Books API
I tried to create a java8 development environment with Chocolatey
[Rails] I tried to create a mini app with FullCalendar
I tried to verify this and that of Spring @ Transactional
I tried using Hotwire to make Rails 6.1 scaffold a SPA
I tried to create React.js × TypeScript × Material-UI on docker environment
I tried to build the environment little by little using docker
[Rails] I tried to implement "Like function" using rails and js
I made a Dockerfile to start Glassfish 5 using Oracle Java
Create a lightweight STNS Docker image
I tried to create a Spring MVC development environment on Mac
[Unity] I tried to make a native plug-in UniNWPathMonitor using NWPathMonitor
I tried to build a simple application using Dockder + Rails Scaffold
2. Create Docker image and register Registry
Create a Docker Image for redoc-cli and register it on Docker Hub
I tried to build a laravel operating environment while remembering Docker
I tried to make a machine learning application with Dash (+ Docker) part1 ~ Environment construction and operation check ~
I tried to make a simple face recognition Android application using OpenCV
Inexperienced create a weather app using OpenWeatherMap and deploy it to Netlify
How to quickly create a reverse proxy that supports HTTPS with Docker
I introduced WSL2 + Ubuntu to Window10 and tried using GDC, DMD, LDC
[Rails] I tried to implement a transaction that combines multiple DB processes
I tried to make a Web API that connects to DB with Quarkus
I tried to make my own transfer guide using OpenTripPlanner and GTFS
I tried to build a Firebase application development environment with Docker in 2020
I made a virtual currency arbitrage bot and tried to make money
[Docker] How to create a virtual environment for Rails and Nuxt.js apps
I tried to make a talk application in Java using AI "A3RT"
How to create a convenient method that utilizes generics and functional interfaces
Create a web environment quickly using Docker
I tried using Scalar DL with Docker
What is Docker? I tried to summarize
Docker Compact Manual (4: Create a custom image)
I made a bulletin board using Docker 1
I installed WSL2 without using Microsoft Store and tried to build an environment where Docker can be used
[Java] I installed JDBC and tried to connect with servlet + MySQL. (There is a version using DAO / Bean)
How to create a small docker image of openjdk 11 (ea) application (1GB → 85MB)
[Android] I want to create a ViewPager that can be used for tutorials
I tried to make a machine learning application with Dash (+ Docker) part3 ~ Practice ~
A story when I tried to make a video by linking Processing and Resolume
[Rails / JavaScript / Ajax] I tried to create a like function in two ways.
Test, build, and push your Docker image to GitHub Container Registry using GitHub Actions
A memo to simply create a form using only HTML and CSS in Rails 6
[Java] I tried to connect using a connection pool with Servlet (tomcat) & MySQL & Java
I tried printing a form with Spring MVC and JasperReports Extra edition (image edition)
[Azure] I tried to create a Java application for free-Web App creation- [Beginner]