i'm following the quarkus getting-started tutorials, was able to generate executable and ran it but cannot get the docker image run.
Steps:
./mvnw package -Pnative (it worked)
docker build -f src/main/docker/Dockerfile.native -t quarkus/getting-started . (it worked
docker run -i --rm -p 8080:8080 quarkus/getting-started, got this error:
standard_init_linux.go:228: exec user process caused: exec format error
my settings:
Quarkus version: 2.7.2.final
macOS Catalina version 10.15.7
Java version:
openjdk version "11.0.14" 2022-01-18
OpenJDK Runtime Environment GraalVM CE 22.0.0.2 (build 11.0.14+9-jvmci-22.0-b05)
OpenJDK 64-Bit Server VM GraalVM CE 22.0.0.2 (build 11.0.14+9-jvmci-22.0-b05, mixed mode, sharing)
maven version: 3.8.3
please help
The problem is that you build your native executable on Mac and then push it to a Linux based container. You could use
./mvnw package -Dnative -Dquarkus.native.container-build=true
to instruct Quarks to build a native Linux executable using a container runtime (Docker in your case).
https://quarkus.io/guides/building-native-image#container-runtime
Related
I can check if docker is installed through the which docker or command -v docker commands. But I need to check if docker's compose plugin is installed (I will use it like docker compose up -d later).
Write on terminal:
$ docker compose --version
The return would look like:
Docker version X.Y.Z, build 95e78f4241
Source: https://docs.docker.com/engine/reference/commandline/compose/
For me it worked a little bit differently, docker compose --version just gave me the CLI options of docker.
hotfix#localhost:~$ docker -v
Docker version 23.0.1, build a5ee5b1
hotfix#localhost:~$ docker compose version
Docker Compose version v2.16.0
I am using Ubuntu 22.04.01 LTS and I followed these instructions from Docker for installation.
⚠️ Note
Beware that Docker is currently transitioning from Compose v1 to v2. The older version is called docker-compose which version you can check with:
docker-compose --version
You can just check for docker-compose version docker-compose --version
If docker-compose is not installed, It will throw an error docker-compose in unrecognized.
I was trying to install software on 32-bit CentOS 4.8 and ran into a problem. I ran the container using docker run -d(or -itd). The installation software keeps pointing to a x86_64 folder where it doesn't exist. I was so confused because I'm sure I used the correct CentOS image. I ran uname -a and it tells me that my container architecture is 64-bit (x86_64).
I try to run it using docker run -it command instead and when I check uname -a it correctly shows that I'm using 32-bit image.
My question is, is there any explanation why -d flag changes the architecture?
I'm using Docker version 20.10.5 on Windows 10 (64-bit).
Edit: Even when I start a stopped container from docker run -it command using docker start, it use 64-bit architecture instead. I need to run it using docker start -i.
I have an m1 mac and I am trying to run a amd64 based docker image on my arm64 based host platform. However, when I try to do so (with docker run) I get the following error:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested.
When I try adding the tag --platform linux/amd64 the error message doesn't appear, but I can't seem to go into the relevant shell and docker ps -a shows that the container is immediately exited upon starting. Would anyone know how I can run this exact image on my machine given the circumstances/how to make the --platform tag work?
Using --platform is correct. On my M1 Mac I'm able to run both arm64 and amd64 versions of the Ubuntu image from Docker Hub. The machine hardware name provided by uname proves it.
# docker run --rm -ti --platform linux/arm/v7 ubuntu:latest uname -m
armv7l
# docker run --rm -ti --platform linux/amd64 ubuntu:latest uname -m
x86_64
Running amd64 images is enabled by Rosetta2 emulation, as indicated here.
Not all images are available for ARM64 architecture. You can add --platform linux/amd64 to run an Intel image under emulation.
If the container is exiting immediately, that's a problem with the specific container you're using.
To address the problem of your container immediately exiting after starting, try using the entrypoint flag to overwrite the container's entry point. It would look something like this:
docker run -it --entrypoint=/bin/bash image_name
Credit goes to this other SO answer that helped me solve a similar issue on my own container.
On the beta release of the docker app, you get docker-compose version 1.11.1, which only supports file version 2.0 (that is, the docker-compose file has 'version: "2"' at the top).
There are a few features that I would love to use from 2.1+, but it seems docker for mac is a bit behind.
Is there a way for me to use 2.1+ on a mac, or am I just going to have to wait for the 1.12 docker-compose release on mac?
The latest Docker for Mac (non beta) supports the 2.1 compose file features.
You may be confusing Docker Compose and Docker Engine versions.
A version 2.1 compose file requires a Docker Engine running 1.12.0+ and I can't find a documented Compose version requirement, but it works with Docker Compose 1.10+ here.
Compose client
docker-compose -v
Docker client
docker -v
Docker daemon/server
docker info | grep ^Server
I've just install Docker on Mac OS 10.10.5 and ran Kitematic after that and got a hug error right away. This is the beginning of it, I can paste the rest if it will help
Command failed: /usr/local/bin/docker-machine -D start default,Docker
Machine Version: 0.7.0, build a650a40,Found binary path at
/usr/local/bin/docker-machine,Launching plugin server for driver
virtualbox,Plugin server listening at address 127.0.0.1:62284,()
Calling .GetVersion,Using API Version 1,() Calling .SetConfigRaw,()
Calling .GetMachineName,command=start machine=default,(default)
Calling .GetState,(default) DBG | COMMAND: /usr/local/bin/VBoxManage
showvminfo default --machinereadable,(default) DBG | STDOUT:,(default)
DBG
$ docker version
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Tue Apr 26 23:44:17 2016
OS/Arch: darwin/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Stopped Unknown
I've read the Get started with Docker Machine and a local VM one more time and found I need to run eval "$(docker-machine env default)" to setup the env-var for docker on Mac OS X.