File tree Expand file tree Collapse file tree 4 files changed +31
-1
lines changed
lib/interface/cli/commands/pipeline Expand file tree Collapse file tree 4 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -35,4 +35,15 @@ RUN yarn generate-completion
35
35
RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
36
36
37
37
RUN codefresh components update --location components
38
+
39
+ # we keep /root as home directory because cli by default looks for $HOME/.cfconfig
40
+ # and we do not want to break user automation if he used to bind his .cfconfig
41
+ # to the /root/.cfconfig
42
+ RUN adduser -D -h /root -s /bin/sh cfu \
43
+ && chown -R $(id -g cfu) /root /cf-cli \
44
+ && chgrp -R $(id -g cfu) /root /cf-cli \
45
+ && chmod -R g+rwX /root
46
+
47
+ USER cfu
48
+
38
49
ENTRYPOINT ["codefresh" ]
Original file line number Diff line number Diff line change @@ -37,4 +37,14 @@ RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
37
37
38
38
RUN codefresh components update --location components
39
39
40
+ # we keep /root as home directory because cli by default looks for $HOME/.cfconfig
41
+ # and we do not want to break user automation if he used to bind his .cfconfig
42
+ # to the /root/.cfconfig
43
+ RUN useradd -m -d /root -s /bin/sh cfu \
44
+ && chown -R $(id -g cfu) /root /cf-cli \
45
+ && chgrp -R $(id -g cfu) /root /cf-cli \
46
+ && chmod -R g+rwX /root
47
+
48
+ USER cfu
49
+
40
50
ENTRYPOINT ["codefresh"]
Original file line number Diff line number Diff line change @@ -67,6 +67,15 @@ class RunLocalCommand extends RunBaseCommand {
67
67
this . docker . modem . followProgress ( stream , onFinished , onProgress ) ;
68
68
}
69
69
} ) ;
70
+ } ) . catch ( ( err ) => {
71
+ if ( err && _ . includes ( err . message , 'connect EACCES /var/run/docker.sock' ) ) {
72
+ const message = 'Could not access /var/run/docker.sock. Warning: If you are trying to run Codefresh CLI '
73
+ + 'through the docker container please consider to add option `--user root` to the `docker run` command. '
74
+ + 'Recently we updated our Codefresh CLI images to run with rootless user and in order to access '
75
+ + '/var/run/docker.sock you need to have root permissions.' ;
76
+ return Promise . reject ( new Error ( message ) ) ;
77
+ }
78
+ return Promise . reject ( err ) ;
70
79
} ) ;
71
80
}
72
81
async runImpl ( request ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " codefresh" ,
3
- "version" : " 0.81.9 " ,
3
+ "version" : " 0.82.0 " ,
4
4
"description" : " Codefresh command line utility" ,
5
5
"main" : " index.js" ,
6
6
"preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments