1-Grab the arguments from the command line User and UserID
2-Install Ubuntu packages needed
3-Creates your user inside the new container image
4-Put your user inside the container as a SuperUser
5-Creates a working directory
6-Login on the container as your User
7-Download miniconda
8-Put conda on the path
9-Put conda initializaton on the bash script
10-Install all conda packages (PyTorch, Fastai, Jupyter, etc…)
11-Create initialization of Jupyter
12-Create initialization of the standard shell when you try to run the container
If your building stop at any step your image will not be build entirely. So you will need to fix it. Here is working nice. I don’t know exactly why your user cold not been created on Mac. Without fixing this you wont have the correct image available to use.
This is what is happening running the build command in Power Shell, I can’t find the error, sorry for my no knowledge of the topic:
Step 8/17 : RUN useradd -Um ${USER}
—> Running in 82f3a56787d5
Usage: useradd [options] LOGIN
useradd -D
useradd -D [options]
Options:
-b, --base-dir BASE_DIR base directory for the home directory of the
new account
-c, --comment COMMENT GECOS field of the new account
-d, --home-dir HOME_DIR home directory of the new account
-D, --defaults print or change default useradd configuration
-e, --expiredate EXPIRE_DATE expiration date of the new account
-f, --inactive INACTIVE password inactivity period of the new account
-g, --gid GROUP name or ID of the primary group of the new
account
-G, --groups GROUPS list of supplementary groups of the new
account
-h, --help display this help message and exit
-k, --skel SKEL_DIR use this alternative skeleton directory
-K, --key KEY=VALUE override /etc/login.defs defaults
-l, --no-log-init do not add the user to the lastlog and
faillog databases
-m, --create-home create the user’s home directory
-M, --no-create-home do not create the user’s home directory
-N, --no-user-group do not create a group with the same name as
the user
-o, --non-unique allow to create users with duplicate
(non-unique) UID
-p, --password PASSWORD encrypted password of the new account
-r, --system create a system account
-R, --root CHROOT_DIR directory to chroot into
-s, --shell SHELL login shell of the new account
-u, --uid UID user ID of the new account
-U, --user-group create a group with the same name as the user
-Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
–extrausers Use the extra users database
The command ‘/bin/sh -c useradd -Um ${USER}’ returned a non-zero code: 2
Step 8/17 : RUN useradd -Um “$USER”
—> Running in 7be90e399d49
useradd: invalid user name ‘’
The command ‘/bin/sh -c useradd -Um “$USER”’ returned a non-zero code: 3
I’m on Windows 10, Power Shell is a command line scripting shell in Windows.
I use it only since I think is more powerful than CMD and “maybe” better supported, didn’t know anything about it.
I have in this laptop also a virtual environment with Ubuntu Budlge installed, problem is can’t connect on Internet using my laptop connection, didn’t know why.
OK windows is a entire different beast
because what is created in linux not influence the files on windows , in case of linux and macos without creating your user inside the container you coun’t share your files without permission.
I will change the docker script so you don’t need to use a user for it.
Successfully tagged fastai:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
I suppose I need to change Docker from Linux like to Windows lilke
after I start and run the docker container and run the jupyter sharing a folder with my linux (from linux to linux) anything I create inside that shared folder from the container without my own user, will be created as ROOT user. So outside the container in the HOst machine I loose access to the file as my default user because linux doesnot allow users touch each other files. Different from windows.
Ok thanks again for your wonderful work!
Having the image up and running, just a (first) stupid question: how I test if fast.ai v1 and Pytorch are working correctly?