oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.6k stars 5.44k forks source link

Oracle Database container build issue when building for linux/amd64 (native on x86_64 ubuntu aswell as with buildx on arm) #1814

Closed torbenrockstar closed 3 years ago

torbenrockstar commented 3 years ago

Hi, as docker now has a public preview for ARM based Macs, i tried to install the Docker Image for the 12.2.0.1 Version but ended up getting the following error:


Checking Docker version.
Ignored MD5 checksum.
==========================
DOCKER info:
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., unknown)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.3.5)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.104-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 1.935GiB
 Name: docker-desktop
 ID: BSNM:34KT:OU37:VT63:RAW4:H2R3:TFWY:IGV7:RPEW:UJPN:BYHZ:RUMX
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

==========================
Building image 'oracle/database:12.2.0.1-se2' ...
[+] Building 39.2s (8/14)
 => [internal] load build definition from Dockerfile                       0.5s
 => => transferring dockerfile: 120B                                       0.0s
 => [internal] load .dockerignore                                          0.6s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/oraclelinux:7-slim      2.4s
 => CACHED [base 1/4] FROM docker.io/library/oraclelinux:7-slim@sha256:0a  0.0s
 => [internal] load build context                                          0.3s
 => => transferring context: 1.64kB                                        0.0s
 => [base 2/4] COPY setupLinuxEnv.sh checkSpace.sh /opt/install/           0.6s
 => [base 3/4] COPY runOracle.sh startDB.sh createDB.sh dbca.rsp.tmpl set  1.3s
 => ERROR [base 4/4] RUN chmod ug+x /opt/install/*.sh &&     sync &&      33.6s
------
 > [base 4/4] RUN chmod ug+x /opt/install/*.sh &&     sync &&     /opt/install/checkSpace.sh &&     /opt/install/setupLinuxEnv.sh &&     rm -rf /opt/install:
#8 1.593 Loaded plugins: ovl
#8 26.04 No package oracle-database-server-12cR2-preinstall available.
#8 26.16 Resolving Dependencies
#8 26.16 --> Running transaction check
#8 26.16 ---> Package openssl.aarch64 1:1.0.2k-19.0.1.el7 will be installed
#8 26.16 --> Processing Dependency: make for package: 1:openssl-1.0.2k-19.0.1.el7.aarch64
#8 26.23 --> Running transaction check
#8 26.23 ---> Package make.aarch64 1:3.82-24.el7 will be installed
#8 26.25 --> Finished Dependency Resolution
#8 26.25
#8 26.25 Dependencies Resolved
#8 26.25
#8 26.25 ================================================================================
#8 26.25  Package       Arch          Version                     Repository        Size
#8 26.25 ================================================================================
#8 26.25 Installing:
#8 26.25  openssl       aarch64       1:1.0.2k-19.0.1.el7         ol7_latest       487 k
#8 26.25 Installing for dependencies:
#8 26.25  make          aarch64       1:3.82-24.el7               ol7_latest       415 k
#8 26.25
#8 26.25 Transaction Summary
#8 26.25 ================================================================================
#8 26.25 Install  1 Package (+1 Dependent package)
#8 26.25
#8 26.25 Total download size: 901 k
#8 26.25 Installed size: 1.9 M
#8 26.25 Downloading packages:
#8 30.26 --------------------------------------------------------------------------------
#8 30.26 Total                                              225 kB/s | 901 kB  00:04
#8 30.26 Running transaction check
#8 30.29 Running transaction test
#8 30.29 Transaction test succeeded
#8 30.29 Running transaction
#8 30.88   Installing : 1:make-3.82-24.el7.aarch64                                   1/2
#8 31.92   Installing : 1:openssl-1.0.2k-19.0.1.el7.aarch64                          2/2
#8 32.34   Verifying  : 1:make-3.82-24.el7.aarch64                                   1/2
#8 32.56   Verifying  : 1:openssl-1.0.2k-19.0.1.el7.aarch64                          2/2
#8 33.09
#8 33.09 Installed:
#8 33.09   openssl.aarch64 1:1.0.2k-19.0.1.el7
#8 33.09
#8 33.09 Dependency Installed:
#8 33.09   make.aarch64 1:3.82-24.el7
#8 33.09
#8 33.09 Complete!
#8 33.16 ln: target '/home/oracle/' is not a directory: No such file or directory
------
executor failed running [/bin/sh -c chmod ug+x $INSTALL_DIR/*.sh &&     sync &&     $INSTALL_DIR/$CHECK_SPACE_FILE &&     $INSTALL_DIR/$SETUP_LINUX_FILE &&     rm -rf $INSTALL_DIR]: exit code: 1

ERROR: Oracle Database Docker Image was NOT successfully created.
ERROR: Check the output and correct any reported problems with the docker build operation.```
Djelibeybi commented 3 years ago

Oracle Linux is available for Am, but Database is not.

torbenrockstar commented 3 years ago

@Djelibeybi dude that's not very usefull at all. how about finding a solution rather than just closing the issue?

apparently you are able to run x86 docker on arm machines, so if you specify docker buildx build --platform linux/amd64 https://github.com/oracle/docker-images/blob/master/OracleDatabase/SingleInstance/dockerfiles/buildDockerImage.sh#L216 here, you overcome the error i posted earlier. it still fails, but a lot further down the installation process

Djelibeybi commented 3 years ago

@torbenrockstar if you send me an M1 Mac, I'll be as helpful as you need . πŸ˜„ Until then, and as you have identified, you'll need to use buildx to build for x86 (like you do to build for Arm on x86). Therefore the convenience scripts will not be useful.

However, I will reopen the issue to see if we can resolve the later build failure.

torbenrockstar commented 3 years ago

πŸ˜… even if i would like to do so, it's quite hard to get your hands on those M1 macs currently

anyway, thanks for reopening the ticket.

the issue i'm getting now is

ERROR [stage-2 2/3] RUN /opt/oracle/oraInventory/orainstRoot.sh &&     /opt/oracle/product/12.2.0.1/dbhome_1/root.sh
------
 > [stage-2 2/3] RUN /opt/oracle/oraInventory/orainstRoot.sh &&     /opt/oracle/product/12.2.0.1/dbhome_1/root.sh:
#13 1.439 /bin/sh: /opt/oracle/oraInventory/orainstRoot.sh: No such file or directory
------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c $ORACLE_BASE/oraInventory/orainstRoot.sh &&     $ORACLE_HOME/root.sh]: exit code: 127

ERROR: Oracle Database Docker Image was NOT successfully created.
ERROR: Check the output and correct any reported problems with the docker build operation.

it originates from this command https://github.com/oracle/docker-images/blob/master/OracleDatabase/SingleInstance/dockerfiles/12.2.0.1/Dockerfile#L109

if i comment out that part, the build will finish without any error, but docker run then (of course) gives some errors

Djelibeybi commented 3 years ago

If that script doesn't exist, the database didn't install properly. You'll need to review the entire output to see what happened earlier.

It may be easier to use the XE image as that requires less resources. On that note, make sure your Docker VM has sufficient CPU and memory allocated to allow the DB installation to complete. There are previous issues you can search for more detail

torbenrockstar commented 3 years ago

hm there aren't any more errors in the output before that error. can i somehow see ALL the output that is generated? sending the output of the script to a file isn't working

Djelibeybi commented 3 years ago

@gvenzl any thoughts?

torbenrockstar commented 3 years ago

actually the same issue is present on a native x86 ubuntu machine on digital ocean, exact same error

Djelibeybi commented 3 years ago

Ok, then its definitely a Database issue. Let me reflag it.

Djelibeybi commented 3 years ago

I changed the title, but please adjust if its inaccurate.

torbenrockstar commented 3 years ago

it's accurate for my local machine, on digital ocean i did not use build x, it fails with the exact config from HEAD of current Master of this repo

torbenrockstar commented 3 years ago

also can be reproduced on ubuntu 18.04 , same error.

can someone confirm?

muthuvenkat commented 3 years ago

I am having the same error in mac, os version 11.2.3


dockerfiles venkat$ ./buildContainerImage.sh -v 19.3.0 -e
Checking Docker version.
Ignored MD5 sum, 'md5sum' command not available.
==========================
Container runtime info:
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.5.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.121-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 1.942GiB
 Name: docker-desktop
 ID: 4RFL:MWFE:SVGQ:GUT6:EIW7:NGBV:ZMIW:QPCJ:BZQJ:AZ36:DVOZ:ZH23
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: gateway.docker.internal:3128
 HTTPS Proxy: gateway.docker.internal:3129
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

==========================
Building image 'oracle/database:19.3.0-ee' ...
[+] Building 523.7s (13/14)                                                                                                                                         
 => [internal] load build definition from Dockerfile                                                                                                           0.0s
 => => transferring dockerfile: 4.10kB                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                              0.0s
 => => transferring context: 2B                                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/oraclelinux:7-slim                                                                                          2.8s
 => [auth] library/oraclelinux:pull token for registry-1.docker.io                                                                                             0.0s
 => [base 1/4] FROM docker.io/library/oraclelinux:7-slim@sha256:f42d5807391d97b3d82c2660fcf5bf9b1207192b3cd2ab6da0a59439cfa279fa                              65.9s
 => => resolve docker.io/library/oraclelinux:7-slim@sha256:f42d5807391d97b3d82c2660fcf5bf9b1207192b3cd2ab6da0a59439cfa279fa                                    0.0s
 => => sha256:401a42e1eb4fe87d89990847d6ef97767b5ac57457c8001203ee2ea137736907 48.26MB / 48.26MB                                                              50.6s
 => => sha256:f42d5807391d97b3d82c2660fcf5bf9b1207192b3cd2ab6da0a59439cfa279fa 547B / 547B                                                                     0.0s
 => => sha256:0ef6f184055022e0c8ffde3f1e923597d08bdc8a6f869158dfe28cbbb6121a52 529B / 529B                                                                     0.0s
 => => sha256:c8fa2ac7772a1b5d45b4826485537981d2056f4f362e7cc220147972adbfb378 1.48kB / 1.48kB                                                                 0.0s
 => => extracting sha256:401a42e1eb4fe87d89990847d6ef97767b5ac57457c8001203ee2ea137736907                                                                     14.4s
 => [internal] load build context                                                                                                                            178.4s
 => => transferring context: 3.07GB                                                                                                                          178.3s
 => [base 2/4] COPY setupLinuxEnv.sh checkSpace.sh /opt/install/                                                                                               0.1s
 => [base 3/4] COPY runOracle.sh startDB.sh createDB.sh dbca.rsp.tmpl setPassword.sh checkDBStatus.sh runUserScripts.sh relinkOracleBinary.sh /opt/oracle/     0.2s
 => [base 4/4] RUN chmod ug+x /opt/install/*.sh &&     sync &&     /opt/install/checkSpace.sh &&     /opt/install/setupLinuxEnv.sh &&     rm -rf /opt/instal  91.2s
 => [builder 1/2] COPY --chown=oracle:dba LINUX.X64_193000_db_home.zip db_inst.rsp installDBBinaries.sh /opt/install/                                         12.1s 
 => [builder 2/2] RUN chmod ug+x /opt/install/*.sh &&     sync &&     /opt/install/installDBBinaries.sh ee                                                    94.2s 
 => [stage-2 1/3] COPY --chown=oracle:dba --from=builder /opt/oracle /opt/oracle                                                                              78.7s 
 => ERROR [stage-2 2/3] RUN /opt/oracle/oraInventory/orainstRoot.sh &&     /opt/oracle/product/19c/dbhome_1/root.sh                                            0.8s 
------                                                                                                                                                              
 > [stage-2 2/3] RUN /opt/oracle/oraInventory/orainstRoot.sh &&     /opt/oracle/product/19c/dbhome_1/root.sh:                                                       
#13 0.788 /bin/sh: /opt/oracle/oraInventory/orainstRoot.sh: No such file or directory                                                                               
------                                                                                                                                                              
executor failed running [/bin/sh -c $ORACLE_BASE/oraInventory/orainstRoot.sh &&     $ORACLE_HOME/root.sh]: exit code: 127

ERROR: Oracle Database container image was NOT successfully created.
ERROR: Check the output and correct any reported problems with the build operation.
BorisaAlargic-cyber commented 3 years ago

Hello, I would like to know is there any new informations regarding this problem ? Is there anyway to install oracle db on m1 mac ?

Thank you.

Djelibeybi commented 3 years ago

There is no way to run Oracle Database on an M1 Mac as there are no Arm binaries for the Database and no way to emulate x86-64 effectively enough for the container to run.

muthuvenkat commented 3 years ago

@Djelibeybi mine is not M1 Mac, this my config 3.1 GHz Dual-Core Intel Core i5

slobodator commented 3 years ago

Hello, I'm M1 owner and I'm really interested in the dockerized oracle DB XE for the development. Could I assist somehow with testing?

doberkofler commented 3 years ago

It would be most important to have an Oracle Database also running on Apple silicon. Is there any plan or even timeline to use an Oracle Database in a Docker container on Apple silicon?

lperry25 commented 3 years ago

Will there be any work on making a docker-container compatible with m1? I just need to know if it will come relatively soon otherwise I need to find a new (older) computer

BorisaAlargic-cyber commented 3 years ago

What you can do,what i did is i downloaded parallels for mac and i ran windows 10 on my mac than i installed oracle db and it work fine

On Mon, 26 Apr 2021 at 08:33, Laura Perry @.***> wrote:

Will there be any work on making a docker-container compatible with m1? I just need to know if it will come relatively soon otherwise I need to find a new (older) computer

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/oracle/docker-images/issues/1814#issuecomment-826546283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOIARSX7D76JIMRDETNHF5DTKUCK3ANCNFSM4U7YBEEA .

doberkofler commented 3 years ago

@BorisaAlargic-cyber

I used to run Windows in VMWare for macOS for years to have a local Oracle Database for development purposed and using Docker is so incredibly more efficient and easy to maintain.

I'm nevertheless very interested in your setup and have a few questions:

BorisaAlargic-cyber commented 3 years ago

Firstly, you can not run docker on parallels because of virtualizaion,you can not run virtual machine on virtual machine.Yes you use special arm version wich can be downloaded from microsoft directly.Yes you can install linux through parallels.Well for the performance i can say that it works very good i have 256GB and 16gb ram m1 air mac,it works just perfect,i didnt look into memory usage.I am still on my faculty those are not some big projects that i have to do.For the last question i dont know really the answer.

On Mon, 26 Apr 2021 at 17:17, Dieter Oberkofler @.***> wrote:

@BorisaAlargic-cyber https://github.com/BorisaAlargic-cyber

I used to run Windows in VMWare for macOS for years to have a local Oracle Database for development purposed and using Docker is so incredibly more efficient and easy to maintain.

I'm nevertheless very interested in your setup and have a few questions:

  • Can parallels run a x86 Windows 10 version or is it a special ARM version?
  • How is performance and memory usage compared to the Oracle Database in a Linux Docker container?
  • Should it also be possible to use Linux instead of Windows?
  • Why is the ARM Version of the Oracle Database needed on Docker but not on parallels?

β€” You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/oracle/docker-images/issues/1814#issuecomment-826922579, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOIARST3UZFA2EIE5RMN2ZTTKV7W5ANCNFSM4U7YBEEA .

doberkofler commented 3 years ago

@BorisaAlargic-cyber If I understand you correctly, you must use the ARM Windows version on Parallels but can still run the x86 version of the Oracle Database? I did not know that this is possible.

doberkofler commented 3 years ago

@Djelibeybi

I'm still quite confused by this SR:

Djelibeybi commented 3 years ago

Hey folks. I realise us Oracle folk have not been explicit in this thread, so here's the deal:

  1. No. Oracle Database will currently not work on an M1-silicon based Mac, due to the limitations of emulating the x86 instruction set on Arm.
  2. No, it is not.
  3. Specifically on getting Oracle Database to work in a Docker container on an M1-based Mac? No. On the concept of the Oracle Database running in some way on 64-bit Arm processors? Probably.

Let me provide a little more context on Arm support from Oracle:

About 10 days ago we launched our new Oracle Cloud Infrastructure Ampere A1 Compute shapes that are powered by the Arm Neoverse-N1 CPU. As part of that launch, we released the Oracle Instant Client for Arm along with Java, GraalVM, MySQL Server, our OCI SDKs and a bunch of other tools, libraries and SDKs.

We've been releasing Oracle Linux for Arm for ages and our Oracle Linux based images for developing with Go, Node.js, Perl, PHP, Python and Ruby are published on GitHub Container Registry for both amd64 and arm64v8, so they will run natively on an M1-based mac.

So it's safe to assume that lots of folks at Oracle are working on Arm support for lots of things from Oracle. When you combine that with the fact that the Apple M1 and Ampere A1 are both ARMv8-A cores you'll discover that once we have stuff working on our Ampere shapes, it should "just work" on Apple's M1 silicon too.

What I can't tell you (unfortunately) is when a particular product is likely to be supported, not just because I'm not allowed to, but also because I have no idea.