Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ FROM ghcr.io/jamesdbrock/ihaskell-notebook:master
# set up a user whose uid is 1000. It is bad practice to run processes in containers as root, and on binder we do not allow root container processes.
ARG NB_USER=rober
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
ENV USER=${NB_USER}
ENV NB_UID=${NB_UID}
ENV HOME=/home/${NB_USER}

USER root

Expand All @@ -20,11 +20,11 @@ RUN pip install RISE
RUN pip install jupyterthemes
#RUN jt -t gruvboxd -T -N -kl

# ---- Add non-root user
#RUN adduser --disabled-password \
# --gecos "Default user" \
# --uid ${NB_UID} \
# ${NB_USER}
# ---- Rename the existing UID 1000 user to the desired username
RUN existing=$(getent passwd ${NB_UID} | cut -d: -f1) && \
if [ "${existing}" != "${NB_USER}" ]; then \
usermod -l ${NB_USER} -d /home/${NB_USER} ${existing}; \
fi

# Make sure the contents of our repo are in ${HOME}
COPY . ${HOME}
Expand Down
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

pushd "$(dirname "${BASH_SOURCE[0]}")"

[[ -n ${1} ]] &&
tagArgs=" -t ${1} "

docker build --build-arg NB_USER=$(whoami) --build-arg NB_UID=$(id -u) ${tagArgs} .

popd
2 changes: 1 addition & 1 deletion lessons/02-Functions-Data-Types-and-Signatures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@
},
"outputs": [],
"source": [
"prodForDubles :: Double -> Double -> Double\n",
"prodForDoubles :: Double -> Double -> Double\n",
"prodForDoubles x y = x * y"
]
},
Expand Down
4 changes: 2 additions & 2 deletions lessons/04-Pattern-matching.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,8 @@
}
],
"source": [
"initials :: String -> String -> String\n",
"initials name lastName = if name == \"\" || lastName == \"\"\n",
"initials' :: String -> String -> String\n",
"initial's name lastName = if name == \"\" || lastName == \"\"\n",
" then \"How was your name again?\"\n",
" else let x = head name\n",
" y = head lastName\n",
Expand Down