diff --git a/Makefile b/Makefile index 7b60bf5..107ac1d 100644 --- a/Makefile +++ b/Makefile @@ -29,11 +29,11 @@ MQ_ARCHIVE_DEV ?= $(MQ_ARCHIVE_DEV_$(MQ_VERSION)) MQ_SDK_ARCHIVE ?= $(MQ_ARCHIVE_DEV_$(MQ_VERSION)) # Options to `go test` for the Docker tests TEST_OPTS_DOCKER ?= -# MQ_IMAGE_ADVANCEDSERVER is the name and tag of the built MQ Advanced image +# MQ_IMAGE_ADVANCEDSERVER is the name of the built MQ Advanced image MQ_IMAGE_ADVANCEDSERVER ?=mqadvanced-server -MQ_TAG_ADVANCEDSERVER ?=$(MQ_VERSION)-$(ARCH)-$(BASE_IMAGE_TAG) -# MQ_IMAGE_DEVSERVER is the name and tag of the built MQ Advanced for Developers image +# MQ_IMAGE_DEVSERVER is the name of the built MQ Advanced for Developers image MQ_IMAGE_DEVSERVER ?=mqadvanced-server-dev +# MQ_TAG is the tag of the built MQ Advanced image & MQ Advanced for Developers image MQ_TAG ?=$(MQ_VERSION)-$(ARCH) # DOCKER is the Docker command to run. Defaults to "podman" if it's available, otherwise "docker" DOCKER ?= $(shell type -p podman || echo docker) @@ -48,8 +48,8 @@ MQM_UID ?= 888 GO_PKG_DIRS = ./cmd ./internal ./test MQ_ARCHIVE_TYPE=LINUX MQ_ARCHIVE_DEV_PLATFORM=linux -# ARCH is the platform architecture (e.g. x86_64, ppc64le or s390x) -ARCH = $(shell uname -m) +# ARCH is the platform architecture (e.g. amd64, ppc64le or s390x) +ARCH=$(if $(findstring x86_64,$(shell uname -m)),amd64,$(shell uname -m)) # BUILD_SERVER_CONTAINER is the name of the web server container used at build time BUILD_SERVER_CONTAINER=build-server # NUM_CPU is the number of CPUs available to Docker. Used to control how many @@ -84,7 +84,7 @@ else endif # Try to figure out which archive to use from the architecture -ifeq "$(ARCH)" "x86_64" +ifeq "$(ARCH)" "amd64" MQ_ARCHIVE_ARCH=X86-64 MQ_DEV_ARCH=x86-64 else ifeq "$(ARCH)" "ppc64le" @@ -339,7 +339,7 @@ lint: $(addsuffix /$(wildcard *.go), $(GO_PKG_DIRS)) golint -set_exit_status $(sort $(dir $(wildcard $(addsuffix /*/*.go, $(GO_PKG_DIRS))))) .PHONY: gosec -gosec: $(info $(SPACER)$(shell printf "Running gosec test"$(END))) +gosec: $(info $(SPACER)$(shell printf "Running gosec test"$(END))) @gosec -fmt=json -out=gosec_results.json cmd/... internal/... 2> /dev/null ;\ cat "gosec_results.json" ;\ cat gosec_results.json | grep HIGH | grep severity > /dev/null ;\ diff --git a/docs/building.md b/docs/building.md index dbeda92..1453742 100644 --- a/docs/building.md +++ b/docs/building.md @@ -11,7 +11,7 @@ If you are working in the Windows Subsystem for Linux, follow [this guide by Mic ## Building a production image -This procedure works for building the MQ Continuous Delivery release, on `x86_64`, `ppc64le` and `s390x` architectures. +This procedure works for building the MQ Continuous Delivery release, on `amd64`, `ppc64le` and `s390x` architectures. 1. Create a `downloads` directory in the root of this repository 2. Download MQ from [IBM Passport Advantage](https://www.ibm.com/software/passportadvantage/) or [IBM Fix Central](https://www.ibm.com/support/fixcentral), and place the downloaded file (for example, `IBM_MQ_9.1.2_UBUNTU_X86-64.tar.gz`) in the `downloads` directory @@ -32,7 +32,7 @@ MQ_ARCHIVE=mq-1.2.3.4.tar.gz MQ_VERSION=1.2.3.4 make build-advancedserver ``` ## Building a developer image -Run `make build-devserver`, which will download the latest version of MQ Advanced for Developers from IBM developerWorks. This is currently only available on the `x86_64` architecture. +Run `make build-devserver`, which will download the latest version of MQ Advanced for Developers from IBM developerWorks. This is currently only available on the `amd64` architecture. You can use the environment variable `MQ_ARCHIVE_DEV` to specify an alternative local file to install from (which must be in the `downloads` directory). @@ -43,4 +43,4 @@ The containerized build process on a RHEL host will write an OCI compliant archi ## Installed components -This image includes the core MQ server, Java, language packs, GSKit, and web server. This can be configured by setting the `MQ_PACKAGES` argument to `make`. \ No newline at end of file +This image includes the core MQ server, Java, language packs, GSKit, and web server. This can be configured by setting the `MQ_PACKAGES` argument to `make`. diff --git a/docs/security.md b/docs/security.md index 2a79629..194f1a3 100644 --- a/docs/security.md +++ b/docs/security.md @@ -16,7 +16,7 @@ docker run \ --env LICENSE=accept \ --env MQ_QMGR_NAME=QM1 \ --detach \ - mqadvanced-server:9.1.2.0-x86_64-ubuntu-16.04 + mqadvanced-server:9.1.2.0-amd64 ``` The MQ Advanced for Developers image does require the "chown", "setuid", "setgid" and "audit_write" capabilities (plus "dac_override" if you're using an image based on Red Hat Enterprise Linux). This is because it uses the "sudo" command to change passwords inside the container. For example, in Docker, you could do the following: @@ -31,9 +31,9 @@ docker run \ --env LICENSE=accept \ --env MQ_QMGR_NAME=QM1 \ --detach \ - mqadvanced-server-dev:9.1.2.0-x86_64-ubuntu-16.04 + mqadvanced-server-dev:9.1.2.0-amd64 ``` ### SELinux -The SELinux label "spc_t" (super-privileged container) is needed to run the MQ container on a host with SELinux enabled. This is due to a current limitation in how MQ data is stored on volumes, which violates the usual policy applied when using the standard "container_t" label. \ No newline at end of file +The SELinux label "spc_t" (super-privileged container) is needed to run the MQ container on a host with SELinux enabled. This is due to a current limitation in how MQ data is stored on volumes, which violates the usual policy applied when using the standard "container_t" label. diff --git a/docs/testing.md b/docs/testing.md index 447b042..461e950 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -24,7 +24,7 @@ make test-advancedserver You can specify the image to use directly by using the `MQ_IMAGE_ADVANCEDSERVER` or `MQ_IMAGE_DEVSERVER` variables, for example: ``` -MQ_IMAGE_ADVANCEDSERVER=mqadvanced-server:9.1.2.0-x86_64-ubuntu-16.04 make test-advancedserver +MQ_IMAGE_ADVANCEDSERVER=mqadvanced-server:9.1.2.0-amd64 make test-advancedserver ``` You can pass parameters to `go test` with an environment variable. For example, to run the "TestGoldenPath" test, run the following command:: @@ -33,7 +33,7 @@ You can pass parameters to `go test` with an environment variable. For example, TEST_OPTS_DOCKER="-run TestGoldenPath" make test-advancedserver ``` -You can also use the same environment variables you specified when [building](./building), for example, the following will try and test an image called `mqadvanced-server:9.1.2.0-x86_64-ubuntu-16.04`: +You can also use the same environment variables you specified when [building](./building), for example, the following will try and test an image called `mqadvanced-server:9.1.2.0-amd64`: ``` MQ_VERSION=9.1.2.0 make test-advancedserver diff --git a/manifests/dockerhub/manifest-9.1.2-UBI.yaml b/manifests/dockerhub/manifest-9.1.2-UBI.yaml new file mode 100644 index 0000000..293a454 --- /dev/null +++ b/manifests/dockerhub/manifest-9.1.2-UBI.yaml @@ -0,0 +1,28 @@ +# © Copyright IBM Corporation 2019 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +image: ibmcom/mq:9.1.2.0-UBI +manifests: + - image: ibmcom/mq:9.1.2.0-UBI-amd64 + platform: + architecture: amd64 + os: linux + - image: ibmcom/mq:9.1.2.0-UBI-ppc64le + platform: + architecture: ppc64le + os: linux + - image: ibmcom/mq:9.1.2.0-UBI-s390x + platform: + architecture: s390x + os: linux diff --git a/manifests/dockerhub/manifest-latest.yaml b/manifests/dockerhub/manifest-latest.yaml index 609c6c3..1ae791e 100644 --- a/manifests/dockerhub/manifest-latest.yaml +++ b/manifests/dockerhub/manifest-latest.yaml @@ -14,16 +14,15 @@ image: ibmcom/mq:latest manifests: - - image: ibmcom/mq:9.1.2.0-x86_64 + - image: ibmcom/mq:9.1.2.0-UBI-amd64 platform: architecture: amd64 os: linux - - image: ibmcom/mq:9.1.2.0-ppc64le + - image: ibmcom/mq:9.1.2.0-UBI-ppc64le platform: architecture: ppc64le os: linux - - image: ibmcom/mq:9.1.2.0-s390x + - image: ibmcom/mq:9.1.2.0-UBI-s390x platform: architecture: s390x os: linux - diff --git a/manifests/dockerstore/manifest-9.1.2-UBI.yaml b/manifests/dockerstore/manifest-9.1.2-UBI.yaml new file mode 100644 index 0000000..b3ae29d --- /dev/null +++ b/manifests/dockerstore/manifest-9.1.2-UBI.yaml @@ -0,0 +1,28 @@ +# © Copyright IBM Corporation 2019 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +image: ibmcorp/mqadvanced-server-dev:9.1.2.0-UBI +manifests: + - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-UBI-amd64 + platform: + architecture: amd64 + os: linux + - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-UBI-ppc64le + platform: + architecture: ppc64le + os: linux + - image: ibmcorp/mqadvanced-server-dev:9.1.2.0-UBI-s390x + platform: + architecture: s390x + os: linux diff --git a/mq-advanced-server-rhel/mq-buildah.sh b/mq-advanced-server-rhel/mq-buildah.sh index 2e33c0c..98a532e 100755 --- a/mq-advanced-server-rhel/mq-buildah.sh +++ b/mq-advanced-server-rhel/mq-buildah.sh @@ -148,7 +148,7 @@ buildah config \ --port 9157/tcp \ --port 9443/tcp \ --os linux \ - --label architecture=x86_64 \ + --label architecture=amd64 \ --label io.openshift.tags="$OSTAG" \ --label io.k8s.display-name="$DISNAME" \ --label io.k8s.description="IBM MQ is messaging middleware that simplifies and accelerates the integration of diverse applications and business data across multiple platforms. It uses message queues to facilitate the exchanges of information and offers a single messaging solution for cloud, mobile, Internet of Things (IoT) and on-premises environments." \ diff --git a/mq-advanced-server-rhel/mqdev-buildah.sh b/mq-advanced-server-rhel/mqdev-buildah.sh index 36ff96f..0509d2b 100755 --- a/mq-advanced-server-rhel/mqdev-buildah.sh +++ b/mq-advanced-server-rhel/mqdev-buildah.sh @@ -93,7 +93,7 @@ buildah config \ --port 9157/tcp \ --port 9443/tcp \ --os linux \ - --label architecture=x86_64 \ + --label architecture=amd64 \ --label io.openshift.tags="mq messaging developer" \ --label io.k8s.display-name="IBM MQ Advanced Server Developer Edition" \ --label io.k8s.description="IBM MQ is messaging middleware that simplifies and accelerates the integration of diverse applications and business data across multiple platforms. It uses message queues to facilitate the exchanges of information and offers a single messaging solution for cloud, mobile, Internet of Things (IoT) and on-premises environments." \ diff --git a/test/messaging/buildah.sh b/test/messaging/buildah.sh index 1d8c6a4..ea58125 100755 --- a/test/messaging/buildah.sh +++ b/test/messaging/buildah.sh @@ -73,7 +73,7 @@ rm -rf ${mnt_mq}/etc/yum.repos.d/* buildah config \ --os linux \ - --label architecture=x86_64 \ + --label architecture=amd64 \ --label name="${imagename%:*}" \ --cmd "" \ --entrypoint '["java", "-classpath", "/opt/app/*", "org.junit.platform.console.ConsoleLauncher", "-p", "com.ibm.mqcontainer.test", "--details", "verbose"]' \