Closed XavierLevaux closed 2 years ago
Hi @XavierLevaux, according to https://github.com/oracle/docker-images/discussions/1951 it is currently not possible to run Oracle Database on ARM chipsets. I have heard that Apple has an x86 emulator that should automatically take care of x86 apps running on M1 but given that I do not have an M1 Mac myself yet, I cannot confirm or deny that.
@gvenzl @XavierLevaux I am also trying to get this running on Apple silicon. I have specified the --platform linux/amd64
attribute to tell Docker to emulate x86, but I am getting the same error as above. I'll try to run buildx
locally to see if that makes a difference, and I'll report any findings.
Additionally, I'm willing to run any tests or gather additional diagnostics if anyone has ideas on how to make it work.
Same issue on my new M1 machine. Have been able to find a workaround, @cofin ?
No. I should have come back to post my findings. I tried to build with different versions of XE with no luck. All resulted in the same TNS error.
I may have to resort to a UTM based Linux VM until there is an acceptable alternative.
Thanks a lot for your research on this, @cofin! It is highly appreciated!
I just ran into the same problem :-(. @gvenzl any chance you could add a note about the apple/arm compatibility problems to your dockerhub docs?
There has been some movement over on https://github.com/oracle/docker-images/discussions/1951 in the meantime.
It seems that users are able to spin up Oracle databases by using a Docker Desktop alternative called colima
.
Unfortunately, I still don't have an M1 Mac so I cannot verify myself but if anybody would be able to verify the approach reported over there, I would be deeply grateful.
The solution seems to be:
brew install colima
brew install docker
colima start --memory 4 --arch x86_64
docker run ...
Awesome, thanks so much for confirming, @salah3x!
Great, thanks a lot, @tomdevroomen!
I would like to add some generic info about how to run these images on Mac M1 into the ReadMe. But given that I am not running on an M1 myself, I'm not entirely sure what method would be the most acceptable to M1 users.
I assume removing Docker Desktop and installing colima
means that all images running on that Mac M1 will have to be x86_64
images? Would that cause any unwanted side effects, other than not wanting to run an x86_64
image when an arm64
is available?
I've got lima running besides docker desktop. Via docker context you're able to choose to run docker commands through lima. I'm using your image within a testcontainers setup, but all those workarounds aren't compatible with testcontainers
Steps to setup with UTM, but compared to (co)lima it is more work and in my experience also slower. apple-silicon-database-installation.md
Think I'll replace my lima installation with colima, as that's exactly what I need from lima :)
setup with colima:
colima
as per https://github.com/abiosoft/colima#installationcolima start --arch x86_64
, the --arch x64_86
is the important part here to match the architecture to be compatible with your docker images.You should give it some time to start up, but I was able to start up the full
version.
@tomdevroomen
but all those workarounds aren't compatible with testcontainers
I was able to make it work w/ testcontainers, the idea is to make sure /var/run/docker.sock
is accessible.
It's symlinked to ~/.colima/default/docker.sock
when starting colima, but double-check it anyway (I had to loosen up the permissions on the file to make it work).
Running colima status
should print the original path of the docker socket, u can also use that to customize testcontainers' host detection.
@tomdevroomen
but all those workarounds aren't compatible with testcontainers
I was able to make it work w/ testcontainers, the idea is to make sure
/var/run/docker.sock
is accessible. It's symlinked to~/.colima/default/docker.sock
when starting colima, but double-check it anyway (I had to loosen up the permissions on the file to make it work). Runningcolima status
should print the original path of the docker socket, u can also use that to customize testcontainers' host detection.
I've tried the testcontainers host detection before, but I wasn't able to make it work. It was overwritten every time with the defaults when starting testcontainers.
I'll give the symlink a try.
@salah3x I've change the host detection for testcontainers, and it is picking up the colima docker.sock.
But it's unable to connect to the Ruyk container
08:13:33.943 [main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with Environment variables, system properties and defaults. Resolved dockerHost=unix:///Users/user/.colima/default/docker.sock
08:13:33.944 [main] INFO org.testcontainers.DockerClientFactory - Docker host IP address is localhost
08:13:34.277 [main] INFO org.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 20.10.11
API Version: 1.41
Operating System: Alpine Linux v3.14
Total Memory: 3938 MB
08:13:34.378 [main] INFO org.testcontainers.utility.RegistryAuthLocator - Credential helper/store (docker-credential-desktop) does not have credentials for index.docker.io
08:13:37.693 [testcontainers-ryuk] WARN org.testcontainers.utility.RyukResourceReaper - Can not connect to Ryuk at localhost:49154
How we you able to resolve this?
Hey all, I've been chatting with my friends at Testcontainers (wink, wink @kiview and @eddumelendez) and they have had other users bring up the question of colima
, see here.
It appears, that with the following config, Testcontainers works just fine with colima
:
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
export DOCKER_HOST="unix://${HOME}/.colima/docker.sock"
Hey all, I've been chatting with my friends at Testcontainers (wink, wink @kiview and @eddumelendez) and they have had other users bring up the question of
colima
, see here.It appears, that with the following config, Testcontainers works just fine with
colima
:export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock export DOCKER_HOST="unix://${HOME}/.colima/docker.sock"
I can confirm this is working 🥳 🥳 🥳
Great, glad to hear that! :)
I've written 2 blogpost to summarise it all:
https://blog.jdriven.com/2022/07/running-oracle-xe-on-apple-silicon/ https://blog.jdriven.com/2022/07/running-oracle-xe-with-testcontainers-on-apple-silicon/
In both blogs I referred to your work @gvenzl
That's amazing, thanks so much for doing that, @tomdevroomen!
I have added the instructions into the ReadMe as well. Hopefully, this will help all other Apple M chip users to run these images!
I've written 2 blogpost to summarise it all:
https://blog.jdriven.com/2022/07/running-oracle-xe-on-apple-silicon/ https://blog.jdriven.com/2022/07/running-oracle-xe-with-testcontainers-on-apple-silicon/
In both blogs I referred to your work @gvenzl
@tomdevroomen Hi have you had any perf issue? I've tried same setup but takes really long for my app to connect to oracle container once it is up and running. Used to take 20 sec, now more like 2 mins.
I've written 2 blogpost to summarise it all: https://blog.jdriven.com/2022/07/running-oracle-xe-on-apple-silicon/ https://blog.jdriven.com/2022/07/running-oracle-xe-with-testcontainers-on-apple-silicon/ In both blogs I referred to your work @gvenzl
@tomdevroomen Hi have you had any perf issue? I've tried same setup but takes really long for my app to connect to oracle container once it is up and running. Used to take 20 sec, now more like 2 mins.
Yes, there's a performance penaulty, as with colima virtualisation is used, so instructions need to be translated. But I take that for granted, as I have no other option.
Worked with colima here as well, thanks!
Hi
It works fine, thanks! but after that all other docker images (here: redis, rabbit) were unusable and i had to create them as new ones and they are visible under 'docker ps' command but not in Docker desktop app. Docker App is empty. Correct?
The Docker Desktop GUI is in no way connected to Colima. The Docker CLI working with Colima probably works through the Docker context.
I've written 2 blogpost to summarise it all:
https://blog.jdriven.com/2022/07/running-oracle-xe-on-apple-silicon/ https://blog.jdriven.com/2022/07/running-oracle-xe-with-testcontainers-on-apple-silicon/
In both blogs I referred to your work @gvenzl
Hi @tomdevroomen. I followed the steps in your first blog post, but I am still running into issues and I don't know what I'm missing. Would appreciate a second pair of eyes for this.
Here is my docker-compose YAML file:
version: '3.1'
services:
oracle:
container_name: oracleDB
image: gvenzl/oracle-xe:18
platform: linux/amd64
ports:
- "1521:1521"
environment:
ORACLE_PASSWORD: "StrongPassword"
And this is the log:
CONTAINER: starting up...
CONTAINER: first database startup, initializing...
CONTAINER: uncompressing database data files, please wait...
CONTAINER: done uncompressing database data files, duration: 14 seconds.
CONTAINER: starting up Oracle Database...
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 08-AUG-2023 10:06:26
Copyright (c) 1991, 2018, Oracle. All rights reserved.
Starting /opt/oracle/product/18c/dbhomeXE/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 18.0.0.0.0 - Production
System parameter file is /opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/17fe1d08dc70/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date 08-AUG-2023 10:06:26
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File /opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/17fe1d08dc70/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
ERROR:
ORA-12547: TNS:lost contact
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
CONTAINER: starting up...
CONTAINER: database already initialized.
CONTAINER: starting up Oracle Database...
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 08-AUG-2023 10:07:20
Copyright (c) 1991, 2018, Oracle. All rights reserved.
Starting /opt/oracle/product/18c/dbhomeXE/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 18.0.0.0.0 - Production
System parameter file is /opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/17fe1d08dc70/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date 08-AUG-2023 10:07:22
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File /opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/17fe1d08dc70/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
ERROR:
ORA-12547: TNS:lost contact
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
<proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
@joc-a Looks like you're still trying to run de oracle image with a default docker env.
ERROR: ORA-12547: TNS:lost contact
is the exact message I got when running it on a default docker env.
Make sure you run you compose file with the docker instance running on Colima.
You can verify this with docker context list
and having the active context pointing to the colima docker endpoint like this (the one with the *
is the currently active one):
docker context list
NAME TYPE DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
colima moby colima unix:///Users/user/.colima/default/docker.sock
default * moby Current DOCKER_HOST based configuration unix:///Users/user/.colima/docker.sock
output of env | grep DOCKER_HOST
should be
> env | grep DOCKER_HOST
DOCKER_HOST=unix:///Users/user/.colima/docker.sock
if this all doesn't point to colima, set the DOCKER_HOST
, which is only active for the current shell where you're working in.
@joc-a Looks like you're still trying to run de oracle image with a default docker env.
ERROR: ORA-12547: TNS:lost contact
is the exact message I got when running it on a default docker env. Make sure you run you compose file with the docker instance running on Colima. You can verify this withdocker context list
and having the active context pointing to the colima docker endpoint like this (the one with the*
is the currently active one):docker context list NAME TYPE DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR colima moby colima unix:///Users/user/.colima/default/docker.sock default * moby Current DOCKER_HOST based configuration unix:///Users/user/.colima/docker.sock
output of
env | grep DOCKER_HOST
should be> env | grep DOCKER_HOST DOCKER_HOST=unix:///Users/user/.colima/docker.sock
if this all doesn't point to colima, set the
DOCKER_HOST
, which is only active for the current shell where you're working in.
@tomdevroomen I set up everything exactly as explained in your reply, but I'm still getting ORA-12547: TNS:lost contact
.
Hi, may I ask for your help? I got * at the end of colima but I still not error " ERROR: ORA-12541: TNS:no listener" could you help me to solve this problem? I used M1 Chip. I thank you in advance
Based on this new image: https://github.com/oracle/docker-images/discussions/1951#discussioncomment-6939131 Is there a chance we would get it ?
They also stated : " container-registry.oracle.com/database/enterprise:19.19.0.0 is only built for linux/arm64 currently."
Hi!
I tried starting Oracle XE on Docker 20.10.10 on an Apple M1 computer.
Here is my docker info:
It fails whith the following log:
Is Oracle XE not yet working on Apple M1?
Thanks!