@@ -120,7 +120,7 @@ RUN useradd -m -s /bin/bash cs61-user && \
120
120
echo "cs61-user ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/cs61-init
121
121
122
122
# create binary reporting version of dockerfile
123
- RUN (echo '#\!/bin/sh'; echo 'if test "x$1" = x-n; then echo 13 ; else echo 13 .arm64; fi') > /usr/bin/cs61-docker-version; chmod ugo+rx,u+w,go-w /usr/bin/cs61-docker-version
123
+ RUN (echo '#\!/bin/sh'; echo 'if test "x$1" = x-n; then echo 15 ; else echo 15 .arm64; fi') > /usr/bin/cs61-docker-version; chmod ugo+rx,u+w,go-w /usr/bin/cs61-docker-version
124
124
125
125
# git build arguments
126
126
ARG USER=CS61\ User
@@ -132,7 +132,12 @@ RUN git config --global user.name "${USER}" && \
132
132
git config --global user.email "${EMAIL}" && \
133
133
(echo "(custom-set-variables"; echo " '(c-basic-offset 4)"; echo " '(indent-tabs-mode nil))") > ~/.emacs && \
134
134
(echo "set expandtab"; echo "set shiftwidth=4"; echo "set softtabstop=4") > ~/.vimrc && \
135
- (echo "if test -f /run/host-services/ssh-auth.sock; then"; echo " sudo chown cs61-user:cs61-user /run/host-services/ssh-auth.sock"; echo "fi") > ~/.bash_profile && \
135
+ cat /dev/null > ~/.bash_profile && \
136
+ echo "# 2022: avoid a Docker bug with user mapping by listing working directory" >> ~/.bash_profile && \
137
+ echo "ls -al > /dev/null" >> ~/.bash_profile && \
138
+ echo "for i in \`mount | grep /home/cs61-user | sed 's/^.*\\(\\/home[^ ]*\\).*/\\\\1/'\`; do ls -al \$i > /dev/null; done" >> ~/.bash_profile && \
139
+ echo "# make ssh-auth.sock user-readable" >> ~/.bash_profile && \
140
+ (echo "if test -f /run/host-services/ssh-auth.sock; then"; echo " sudo chown cs61-user:cs61-user /run/host-services/ssh-auth.sock"; echo "fi") >> ~/.bash_profile && \
136
141
echo ". ~/.bashrc" >> ~/.bash_profile && \
137
142
echo "export PATH=/usr/x86_64-linux-gnu/bin:\$PATH" >> ~/.bashrc && \
138
143
rm -f ~/.bash_logout && \
0 commit comments