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
3535RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
3636
3737RUN 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+
3849ENTRYPOINT ["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
3737
3838RUN codefresh components update --location components
3939
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+
4050ENTRYPOINT ["codefresh"]
Original file line number Diff line number Diff line change @@ -67,6 +67,15 @@ class RunLocalCommand extends RunBaseCommand {
6767 this . docker . modem . followProgress ( stream , onFinished , onProgress ) ;
6868 }
6969 } ) ;
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 ) ;
7079 } ) ;
7180 }
7281 async runImpl ( request ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.81.9 " ,
3+ "version" : " 0.82.0 " ,
44 "description" : " Codefresh command line utility" ,
55 "main" : " index.js" ,
66 "preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments