Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Dockerfile_mbtci_template
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ RUN set -ex \
&& python2.7 --version \
&& python3 --version

# Allow global npm packages install without sudo
RUN set -ex \
&& mkdir ${MTA_USER_HOME}/.npm-global \
&& chown -R ${MTA_USER}:${MTA_USER} ${MTA_USER_HOME}
ENV NPM_CONFIG_PREFIX ${MTA_USER_HOME}/.npm-global
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the spec it's
ENV <key>=<value>
does it work without the equal too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are working. The current Dockerfile use space, so let's keep it consistent with the style already used.


ENV PATH=$PATH:./node_modules/.bin HOME=${MTA_USER_HOME}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the image i used i do not have this path entry:

mta@63fceb6d640d:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

is it intended that the root user has the home of mta?

root@b40df04c7063:/project# id
uid=0(root) gid=0(root) groups=0(root)
root@b40df04c7063:/project# echo $HOME
/home/mta

Copy link
Contributor Author

@jerome-benoit jerome-benoit Jan 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not intended and a genuine security bug, and as well as the HOME env variable redefinition.
The PATH env variable mangling is buggy as hell in that Dockerfile. I plan to fix it but in another PR.

Thanks.

WORKDIR /project
USER ${MTA_USER}
USER ${MTA_USER}