Add web server to dev image

This commit is contained in:
Arthur Barr
2018-03-12 11:14:59 +00:00
parent 104098c7b4
commit 10e448056b
19 changed files with 621 additions and 20 deletions

View File

@@ -12,19 +12,45 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Build stage to build Go code
###############################################################################
FROM golang:1.9 as builder
WORKDIR /go/src/github.com/ibm-messaging/mq-container/
COPY cmd/ ./cmd
COPY internal/ ./internal
COPY vendor/ ./vendor
# Re-build runmqserver, with code tagged with 'mqdev' enabled
RUN go build --tags 'mqdev' ./cmd/runmqserver
RUN go build ./cmd/runmqdevserver/
# Run all unit tests
RUN go test -v ./cmd/runmqdevserver/...
###############################################################################
# Main build stage
###############################################################################
FROM mqadvanced-server-dev-base:9.0.4.0-x86_64-ubuntu-16.04
# Enable MQ developer default configuration
ENV MQ_DEV=true
# Default administrator password
ENV MQ_ADMIN_PASSWORD=passw0rd
## Add admin and app users, and set a default password for admin
RUN useradd admin -G mqm \
&& groupadd mqclient \
&& useradd app -G mqclient,mqm \
&& echo admin:passw0rd | chpasswd
&& echo admin:$MQ_ADMIN_PASSWORD | chpasswd
COPY dev.mqsc /etc/mqm/
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY --from=builder /go/src/github.com/ibm-messaging/mq-container/runmqserver /usr/local/bin/
COPY --from=builder /go/src/github.com/ibm-messaging/mq-container/runmqdevserver /usr/local/bin/
# Copy template MQSC for default developer configuration
COPY incubating/mqadvanced-server-dev/dev.mqsc.tpl /etc/mqm/
# Copy web XML files for default developer configuration
COPY incubating/mqadvanced-server-dev/web /etc/mqm/web
RUN chmod +x /usr/local/bin/runmq*
# Enable MQ developer default configuration
ENV MQ_DEV=true
EXPOSE 9443
ENTRYPOINT ["entrypoint.sh"]
ENTRYPOINT ["runmqdevserver"]