Skip to content

Commit

Permalink
Merge pull request #46 from guzman-raphael/master
Browse files Browse the repository at this point in the history
Allow creating in main when uid changes at startup
  • Loading branch information
jverswijver authored Oct 11, 2022
2 parents fe9fb41 + fb0dac6 commit 07a55b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions dist/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ RUN \
export uid=3000 gid=$(awk -F':' '/^anaconda/{print $3}' /etc/group) && \
mkdir -p /home/anaconda && \
mkdir /main && \
chmod g+w /main && \
echo "anaconda:x:${uid}:${gid}:Developer,,,:/home/anaconda:/bin/sh" >> /etc/passwd && \
# echo "anaconda:x:${uid}:" >> /etc/group && \
chown ${uid}:${gid} -R /home/anaconda && \
Expand Down
1 change: 1 addition & 0 deletions dist/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN \
export uid=3000 gid=$(awk -F':' '/^anaconda/{print $3}' /etc/group) && \
mkdir -p /home/anaconda && \
mkdir /main && \
chmod g+w /main && \
echo "anaconda:x:${uid}:${gid}:Developer,,,:/home/anaconda:/bin/bash"\
>> /etc/passwd && \
# echo "anaconda:x:${uid}:" >> /etc/group && \
Expand Down
6 changes: 5 additions & 1 deletion tests/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ assert ()
if ! eval "$2"; then
echo "Assertion ($1) failed: \"$2\""
echo "File \"$0\", line $lineno"
echo "---------------- TEST[$SHELL_CMD_FLAGS]: $1 ❌ ----------------" | \
tr -d '\t'
exit $E_ASSERT_FAILED
else
echo "---------------- TEST[$SHELL_CMD_FLAGS]: $1 ✔️ ----------------" | \
echo "---------------- TEST[$SHELL_CMD_FLAGS]: $1 ----------------" | \
tr -d '\t'
fi
}
Expand All @@ -35,6 +37,8 @@ validate () {
assert "username" "[ $($SHELL_CMD "id -u -n") == anaconda ]" $LINENO
assert "default group" "[ $($SHELL_CMD "id -g -n") == anaconda ]" $LINENO
assert "home" "[ $($SHELL_CMD "cd ~ && pwd") == '/home/anaconda' ]" $LINENO
assert "create in main" "[ $($SHELL_CMD \
"touch /main/something && echo works") == works ]" $LINENO
assert "conda channel priority config" "[ $($SHELL_CMD 'eval "$(cat)"' <<-END
conda config --show channel_priority | awk -F': ' '{print \$2}'
END
Expand Down

0 comments on commit 07a55b8

Please sign in to comment.