ot4i / ace-docker

73 stars 167 forks source link

Build error extending base ACE 12 image #196

Closed musgovalerio closed 1 month ago

musgovalerio commented 1 year ago

Hello!

I have problems extending base ACE 12 image using BARs Sample. I haven't modified any file, just executed the command described in the BARs Sample page, changing the FROMIMAGE parameter to my base ACE 12 image, and the command did not finished because mqsiprofile was not found. The thing is that the base image works if I run it, so I don't know how to solve this problem.

Here is the docker version info:

Client:
 Cloud integration: v1.0.35
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:53:15 2023
 OS/Arch:           windows/amd64
 Context:           default

I got ACE 12 for developer image from IBM repo:

Version : 12.0.4.0-r2 [EOS] 
Image location: icr.io/appc-dev/ace-server@sha256:a41f7501fe4025d2705bcabf1ad2ff523bcaf9ec263b98054501de1fc0cf5f62

The build command I used: docker build -t aceapp --build-arg FROMIMAGE=icr.io/appc-dev/ace-server --file Dockerfile .

The output from the command above:

[+] Building 1.5s (7/7) FINISHED                                                                                                                                                                                              docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.0s
 => => transferring dockerfile: 1.13kB                                                                                                                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                                                         0.0s
 => [internal] load metadata for icr.io/appc-dev/ace-server:latest                                                                                                                                                                      0.7s
 => [internal] load build context                                                                                                                                                                                                       0.0s
 => => transferring context: 45B                                                                                                                                                                                                        0.0s
 => [1/3] FROM icr.io/appc-dev/ace-server@sha256:68c6ad08a5677bba90c063e1784f28c858dd4921de1658027c037f5d6629b3b8                                                                                                                       0.0s
 => CACHED [2/3] COPY *.bar /tmp                                                                                                                                                                                                        0.0s
 => ERROR [3/3] RUN export LICENSE=accept     && . /opt/ibm/ace-12/server/bin/mqsiprofile     && set -x && for FILE in /tmp/*.bar; do        echo "$FILE" >> /tmp/deploys &&        ibmint package --compile-maps-and-schemas --input-  0.8s
------
 > [3/3] RUN export LICENSE=accept
     && . /opt/ibm/ace-12/server/bin/mqsiprofile
     && set -x && for FILE in /tmp/*.bar; do
        echo "$FILE" >> /tmp/deploys &&
        ibmint package --compile-maps-and-schemas --input-bar-file "$FILE" --output-bar-file /tmp/temp.bar  2>&1 | tee -a /tmp/deploys &&
        ibmint deploy --input-bar-file /tmp/temp.bar --output-work-directory /home/aceuser/ace-server/ 2>&1 | tee -a /tmp/deploys; done
     && ibmint optimize server --work-dir /home/aceuser/ace-server
     && chmod -R ugo+rwx /home/aceuser/:
0.757 /bin/sh: /opt/ibm/ace-12/server/bin/mqsiprofile: No such file or directory
Dockerfile:16
--------------------
  15 |     COPY *.bar /tmp
  16 | >>> RUN export LICENSE=accept \
  17 | >>>     && . /opt/ibm/ace-12/server/bin/mqsiprofile \
  18 | >>>     && set -x && for FILE in /tmp/*.bar; do \
  19 | >>>        echo "$FILE" >> /tmp/deploys && \
  20 | >>>        ibmint package --compile-maps-and-schemas --input-bar-file "$FILE" --output-bar-file /tmp/temp.bar  2>&1 | tee -a /tmp/deploys && \
  21 | >>>        ibmint deploy --input-bar-file /tmp/temp.bar --output-work-directory /home/aceuser/ace-server/ 2>&1 | tee -a /tmp/deploys; done \
  22 | >>>     && ibmint optimize server --work-dir /home/aceuser/ace-server \
  23 | >>>     && chmod -R ugo+rwx /home/aceuser/
  24 |
--------------------
ERROR: failed to solve: process "/bin/sh -c export LICENSE=accept     && . /opt/ibm/ace-12/server/bin/mqsiprofile     && set -x && for FILE in /tmp/*.bar; do        echo \"$FILE\" >> /tmp/deploys &&        ibmint package --compile-maps-and-schemas --input-bar-file \"$FILE\" --output-bar-file /tmp/temp.bar  2>&1 | tee -a /tmp/deploys &&        ibmint deploy --input-bar-file /tmp/temp.bar --output-work-directory /home/aceuser/ace-server/ 2>&1 | tee -a /tmp/deploys; done     && ibmint optimize server --work-dir /home/aceuser/ace-server     && chmod -R ugo+rwx /home/aceuser/" did not complete successfully: exit code: 1

Please can you help me solving this problem?

Regards

Hugo Medina

andyedwardsibm commented 1 year ago

From your initial evidence, you're trying to build with icr.io/appc-dev/ace-server@sha256:a41f7501fe4025d2705bcabf1ad2ff523bcaf9ec263b98054501de1fc0cf5f62 as the base/from image, but from the build logs, it's pulling icr.io/appc-dev/ace-server@sha256:68c6ad08a5677bba90c063e1784f28c858dd4921de1658027c037f5d6629b3b8

Looking inside that image (ace-server@sha256:68c6...) shows that /opt/ibm/ace-12 doesn't exist, but /opt/ibm/ace-11 does...

$# docker run --rm -it --entrypoint bash icr.io/appc-dev/ace-server@sha256:68c6ad08a5677bba90c063e1784f28c858dd4921de1658027c037f5d6629b3b8

[aceuser@a0eb38882d95 ~]$ ls /opt/ibm/
ace-11

i.e. that's an old ACE v11 image...

Can you try running your build command and specify the exact image to build from, i.e. docker build -t aceapp --build-arg FROMIMAGE=icr.io/appc-dev/ace-server@sha256:a41f7501fe4025d2705bcabf1ad2ff523bcaf9ec263b98054501de1fc0cf5f62 --file Dockerfile .

mattbaileyuk commented 1 year ago

@musgovalerio The samples in this repo are designed to extend the base ACE image not the ace-server image from the App Connect Operator release. You'll want to use an image from the list at https://www.ibm.com/docs/en/app-connect/12.0?topic=cacerid-building-sample-app-connect-enterprise-image-using-docker#aceimages__title__1 in your FROM or in the buildarg as @andyedwardsibm suggested.

domstorey commented 9 months ago

@musgovalerio We have recently updated this repo here https://github.com/ot4i/ace-docker/pull/201 for 12.0.10.0 so hopefully this will help with your issue.

IBMRob commented 1 month ago

/Stale