Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] initium cli is always using the default unix socket #118

Open
LucaLanziani opened this issue Sep 27, 2023 · 0 comments
Open

[bug] initium cli is always using the default unix socket #118

LucaLanziani opened this issue Sep 27, 2023 · 0 comments

Comments

@LucaLanziani
Copy link
Member

LucaLanziani commented Sep 27, 2023

We need to make so initium will use the current context.

Initium is trying to use the default socket to connect to docker

> $ initium build                                                                                                                                                                                        ⬡ 19.0.0 [±main ✓]
Dockerfile Location: Dockerfile.initium
Building initium-nodejs-demo-app:latest
2023/09/27 14:47:57 FATA Failed to build docker image Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

docker instead as the rancher-desktop set as current context

lucalanziani@LUCAL-ITMAC22 ~/code/initium-nodejs-demo-app                                                                                                                                                        [14:48:06]
> $ docker context ls                                                                                                                                                                                    ⬡ 19.0.0 [±main ✓]
NAME                DESCRIPTION                               DOCKER ENDPOINT                                          ERROR
colima              colima                                    unix:///Users/lucalanziani/.colima/default/docker.sock   
default             Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                              
rancher-desktop *   Rancher Desktop moby context              unix:///Users/lucalanziani/.rd/docker.sock               

We can force initium to use that conext setting the DOCKER_HOST environment variable

lucalanziani@LUCAL-ITMAC22 ~/code/initium-nodejs-demo-app                                                                                                                                                        [14:48:17]
> $ DOCKER_HOST=unix:///Users/lucalanziani/.rd/docker.sock initium build                                                                                                                                 ⬡ 19.0.0 [±main ✓]
Dockerfile Location: Dockerfile.initium
Building initium-nodejs-demo-app:latest
Step 1/10 : FROM node:20.2.0 AS build-env
20.2.0: Pulling from library/node
b04fae59f135: Pulling fs layer 
24cef00b9ad9: Pulling fs layer 
1db91b65282b: Pulling fs layer 
54db3e52d959: Waiting 
2b2d5a4c9703: Waiting 
c07b95efdf4b: Waiting 
c3f4f824faef: Waiting 
d39d890dd567: Waiting 

A better option is to have initium be aware of the current context

@ghost ghost self-assigned this Oct 3, 2023
@ghost ghost removed their assignment Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants