From 281cdc4578c197d84064cccc780471168ddc2853 Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Tue, 5 Mar 2019 09:47:58 +0000 Subject: [PATCH 1/5] Update RHEL build README --- mq-advanced-server-rhel/README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mq-advanced-server-rhel/README.md b/mq-advanced-server-rhel/README.md index c4461685..ad6e4388 100644 --- a/mq-advanced-server-rhel/README.md +++ b/mq-advanced-server-rhel/README.md @@ -1,7 +1,3 @@ -This is a work-in-progress for a Docker image based on Red Hat Enterprise Linux (RHEL). +# RHEL-based container build -The current MQ container build requires Docker V17.05 or greater (required features include multi-stage Docker build, and "ARG"s in the "FROM" statement). Red Hat Enterprise Linux V7.5 includes Docker up to version V1.13. - -In order to build images with Red Hat Enterprise Linux, license registration is required. The license of the host server can be used, as long as you either use Red Hat's patched version of Docker (which is an old version), or if you use alternative container management tools such as [`buildah`](https://github.com/projectatomic/buildah/) and `podman` (from [`libpod`](https://github.com/projectatomic/libpod)). - -This directory contains scripts for building with `buildah`. The build itself isn't containerized, so more software than usual is needed on the RHEL host, so an Ansible playbook is also provided to help set up the host. \ No newline at end of file +Build scripts for building a container image based on Red Hat Enterprise Linux (RHEL), using the [`buildah`](https://github.com/containers/buildah) tool. buildah is supported on RHEL V7.5 and greater. \ No newline at end of file From 5ef532d2c12ad260e72620ee071503c035641552 Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Tue, 5 Mar 2019 10:19:21 +0000 Subject: [PATCH 2/5] Don't use redist client for Go SDK because of P+Z support --- Makefile-UBUNTU | 8 ++++++-- incubating/mq-golang-sdk/Dockerfile | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Makefile-UBUNTU b/Makefile-UBUNTU index c4a8f103..c8b9354b 100644 --- a/Makefile-UBUNTU +++ b/Makefile-UBUNTU @@ -266,11 +266,15 @@ else build-sdk-ex: MQ_PACKAGES=MQSeriesRuntime-*.rpm MQSeriesSDK-*.rpm MQSeriesSamples*.rpm endif build-sdk-ex: docker-version docker-pull + $(info $(shell printf $(TITLE)"Build $(MQ_IMAGE_SDK)"$(END))) $(call docker-build-mq,$(MQ_IMAGE_SDK),incubating/mq-sdk/Dockerfile,$(MQ_SDK_ARCHIVE),"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers SDK (Non-Warranted)",$(MQ_VERSION)) .PHONY: build-golang-sdk -build-golang-sdk: - $(DOCKER) build -t $(MQ_IMAGE_GOLANG_SDK) -f incubating/mq-golang-sdk/Dockerfile . +build-golang-sdk: docker-version build-sdk + $(info $(shell printf $(TITLE)"Build $(MQ_IMAGE_GOLANG_SDK)"$(END))) + @echo hello + $(DOCKER) build --build-arg BASE_IMAGE=$(MQ_IMAGE_SDK) -t $(MQ_IMAGE_GOLANG_SDK) -f incubating/mq-golang-sdk/Dockerfile . + @echo goodbye .PHONY: docker-pull docker-pull: diff --git a/incubating/mq-golang-sdk/Dockerfile b/incubating/mq-golang-sdk/Dockerfile index b66368f1..ff5dc3b6 100644 --- a/incubating/mq-golang-sdk/Dockerfile +++ b/incubating/mq-golang-sdk/Dockerfile @@ -11,11 +11,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +ARG BASE_IMAGE=mq-sdk:9.1.1.0-x86_64-ubuntu-16.04 -FROM golang:1.10 +FROM $BASE_IMAGE -# Install the MQ redistributable client (including header files) into the Go builder image -RUN mkdir -p /opt/mqm \ - && curl -L https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist/9.1.1.0-IBM-MQC-Redist-LinuxX64.tar.gz | tar -xz -C /opt/mqm -ENV CGO_CFLAGS="-I/opt/mqm/inc/" \ - CGO_LDFLAGS_ALLOW="-Wl,-rpath.*" \ No newline at end of file +COPY incubating/mq-golang-sdk/install-golang.sh /usr/local/bin + +ENV GO_VERSION=1.10 + +ENV PATH="${PATH}:/usr/lib/go-${GO_VERSION}/bin:/go/bin:/usr/local/go/bin" \ + CGO_CFLAGS="-I/opt/mqm/inc/" \ + CGO_LDFLAGS_ALLOW="-Wl,-rpath.*" \ + GOPATH="/go" + +# Install the Go compiler and Git +RUN chmod +x /usr/local/bin/install-golang.sh \ + && sleep 1 \ + && install-golang.sh + +WORKDIR $GOPATH \ No newline at end of file From 0047301335d05257e3ba599d85a53ce2cdab867f Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Tue, 5 Mar 2019 11:31:27 +0000 Subject: [PATCH 3/5] Use Makefile target build-sdk-ex --- Makefile-UBUNTU | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile-UBUNTU b/Makefile-UBUNTU index c8b9354b..d8a875d6 100644 --- a/Makefile-UBUNTU +++ b/Makefile-UBUNTU @@ -270,7 +270,7 @@ build-sdk-ex: docker-version docker-pull $(call docker-build-mq,$(MQ_IMAGE_SDK),incubating/mq-sdk/Dockerfile,$(MQ_SDK_ARCHIVE),"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers SDK (Non-Warranted)",$(MQ_VERSION)) .PHONY: build-golang-sdk -build-golang-sdk: docker-version build-sdk +build-golang-sdk: docker-version build-sdk-ex $(info $(shell printf $(TITLE)"Build $(MQ_IMAGE_GOLANG_SDK)"$(END))) @echo hello $(DOCKER) build --build-arg BASE_IMAGE=$(MQ_IMAGE_SDK) -t $(MQ_IMAGE_GOLANG_SDK) -f incubating/mq-golang-sdk/Dockerfile . From d4a81741cc773e99dc43fbb4c3e225361a03c477 Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Tue, 5 Mar 2019 15:07:51 +0000 Subject: [PATCH 4/5] Prevent re-download of image during build --- Makefile-UBUNTU | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile-UBUNTU b/Makefile-UBUNTU index d8a875d6..b6dadc45 100644 --- a/Makefile-UBUNTU +++ b/Makefile-UBUNTU @@ -270,7 +270,10 @@ build-sdk-ex: docker-version docker-pull $(call docker-build-mq,$(MQ_IMAGE_SDK),incubating/mq-sdk/Dockerfile,$(MQ_SDK_ARCHIVE),"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers SDK (Non-Warranted)",$(MQ_VERSION)) .PHONY: build-golang-sdk -build-golang-sdk: docker-version build-sdk-ex +build-golang-sdk: downloads/$(MQ_SDK_ARCHIVE) build-golang-sdk-ex + +.PHONY: build-golang-sdk-ex +build-golang-sdk-ex: docker-version build-sdk-ex $(info $(shell printf $(TITLE)"Build $(MQ_IMAGE_GOLANG_SDK)"$(END))) @echo hello $(DOCKER) build --build-arg BASE_IMAGE=$(MQ_IMAGE_SDK) -t $(MQ_IMAGE_GOLANG_SDK) -f incubating/mq-golang-sdk/Dockerfile . From 13f620f21a1d0ad7525e816075e71113a86a5fc5 Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Tue, 5 Mar 2019 15:08:07 +0000 Subject: [PATCH 5/5] Increase test timeouts --- test/docker/docker_api_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/docker/docker_api_test.go b/test/docker/docker_api_test.go index 65827e74..f4c4e353 100644 --- a/test/docker/docker_api_test.go +++ b/test/docker/docker_api_test.go @@ -47,7 +47,7 @@ func TestLicenseNotSet(t *testing.T) { containerConfig := container.Config{} id := runContainer(t, cli, &containerConfig) defer cleanContainer(t, cli, id) - rc := waitForContainer(t, cli, id, 10*time.Second) + rc := waitForContainer(t, cli, id, 20*time.Second) if rc != 1 { t.Errorf("Expected rc=1, got rc=%v", rc) } @@ -65,7 +65,7 @@ func TestLicenseView(t *testing.T) { } id := runContainer(t, cli, &containerConfig) defer cleanContainer(t, cli, id) - rc := waitForContainer(t, cli, id, 10*time.Second) + rc := waitForContainer(t, cli, id, 20*time.Second) if rc != 1 { t.Errorf("Expected rc=1, got rc=%v", rc) } @@ -324,7 +324,7 @@ func TestVolumeRequiresRoot(t *testing.T) { defer cleanContainer(t, cli, initCtr.ID) t.Logf("Init container ID=%v", initCtr.ID) startContainer(t, cli, initCtr.ID) - rc = waitForContainer(t, cli, initCtr.ID, 10*time.Second) + rc = waitForContainer(t, cli, initCtr.ID, 20*time.Second) if rc != 0 { t.Errorf("Expected init container to exit with rc=0, got rc=%v", rc) } @@ -404,7 +404,7 @@ func TestStartQueueManagerFail(t *testing.T) { } id := runContainer(t, cli, &containerConfig) defer cleanContainer(t, cli, id) - rc := waitForContainer(t, cli, id, 10*time.Second) + rc := waitForContainer(t, cli, id, 20*time.Second) if rc != 1 { t.Errorf("Expected rc=1, got rc=%v", rc) } @@ -752,7 +752,7 @@ func TestBadLogFormat(t *testing.T) { } id := runContainer(t, cli, &containerConfig) defer cleanContainer(t, cli, id) - rc := waitForContainer(t, cli, id, 5*time.Second) + rc := waitForContainer(t, cli, id, 20*time.Second) if rc != 1 { t.Errorf("Expected rc=1, got rc=%v", rc) }