Skip to content
Snippets Groups Projects
Commit 6114d45a authored by lcappelli's avatar lcappelli
Browse files

Improve RUN layers

* To reduce the image dimension, two RUN commands are merged in one single layer.
* All packages are installed with a single command.
* remove cern and garr mirrors
* the clean commands are the last instructions in the layer
* sudo is installed only in the dockerfile
parent d6d6ca3f
No related branches found
No related tags found
No related merge requests found
......@@ -13,15 +13,12 @@ ENV VSCODE_USER_UID $VSCODE_USER_UID
ENV VSCODE_GID=${VSCODE_USER_UID}
COPY assets/provide-user.sh /docker/
RUN sh /docker/provide-user.sh ${VSCODE_USER} ${VSCODE_USER_UID} ${VSCODE_GID}
RUN echo "include_only=.garr.it,.cern.ch" >> /etc/yum/pluginconf.d/fastestmirror.conf && \
yum clean all && \
yum install -y hostname epel-release && \
yum -y update && \
yum -y install which wget tar sudo file && \
yum clean all && \
rm -rf /var/cache/yum
RUN yum update -y && \
yum install -y hostname epel-release which wget tar sudo file && \
sh /docker/provide-user.sh ${VSCODE_USER} ${VSCODE_USER_UID} ${VSCODE_GID} && \
yum clean all && \
rm -rf /var/cache/yum
COPY assets/setup.sh /docker/
COPY assets/user-setup.sh /docker/
......
......@@ -17,7 +17,6 @@ fi
groupadd --gid $USER_GID $USERNAME
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
yum install -y sudo
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
chmod 0440 /etc/sudoers.d/$USERNAME
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment