File tree 4 files changed +14
-6
lines changed
4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ FROM alpine:3.11
2
2
3
3
MAINTAINER Michael Karlesky <
[email protected] >
4
4
5
+ ENV PROJECT_HOME /lab
6
+ ENV DR_SURLY_HOME /home/drsurly
5
7
6
8
RUN set -ex \
7
9
&& apk update \
@@ -19,7 +21,8 @@ RUN set -ex \
19
21
# #
20
22
21
23
COPY assets/course /usr/local/bin
22
- COPY assets/awesomesauce.zip /home/drsurly/awesomesauce.zip
24
+ COPY assets/start_lab* $DR_SURLY_HOME/
25
+ COPY assets/awesomesauce.zip $DR_SURLY_HOME/
23
26
24
27
RUN chmod +x /usr/local/bin/course
25
28
@@ -28,10 +31,10 @@ RUN chmod +x /usr/local/bin/course
28
31
# # Programming environment setup
29
32
# #
30
33
31
- RUN mkdir /lab
34
+ RUN mkdir $PROJECT_HOME
32
35
33
36
# Working directory at container launch
34
- WORKDIR /lab
37
+ WORKDIR $PROJECT_HOME
35
38
36
39
# When the container launches, run a shell that launches in WORKDIR
37
40
CMD ["/bin/sh" ]
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
TMP=" /tmp/project"
4
- PROJECT_HOME=" /lab"
5
4
PROJECT_ARCHIVE=" awesomesauce.zip"
6
5
7
6
# If no command line parameters given, provide usage banner
@@ -40,11 +39,11 @@ if [ "$(ls -A $PROJECT_HOME)" ]; then
40
39
fi
41
40
42
41
# Extract archive listing and regex to determine base directory of files
43
- BASEDIR=` unzip -l /home/drsurly /$PROJECT_ARCHIVE | grep -E -o ' mvandervoord[^/]+' | head -1`
42
+ BASEDIR=` unzip -l $DR_SURLY_HOME /$PROJECT_ARCHIVE | grep -E -o ' mvandervoord[^/]+' | head -1`
44
43
45
44
# Extract the archive
46
45
echo " > Extracting project..."
47
- unzip -q " /home/drsurly /$PROJECT_ARCHIVE " -d $TMP
46
+ unzip -q " $DR_SURLY_HOME /$PROJECT_ARCHIVE " -d $TMP
48
47
49
48
# Delete any git junk -- first files and then directories
50
49
find $TMP -type f -iname " .git*" -delete
@@ -53,6 +52,9 @@ find $TMP -type d -name ".git" -exec rm -rf "{}" \;
53
52
# Move extracted contents below $basedir to new base directory of /lab
54
53
mv " $TMP /$BASEDIR " /* " $PROJECT_HOME "
55
54
55
+ # Move start_lab convenience scripts inside Docker image to /lab
56
+ mv " $DR_SURLY_HOME " /start_lab* " $PROJECT_HOME "
57
+
56
58
chmod +x " $PROJECT_HOME " /start_lab
57
59
58
60
# Clean up temporary directory
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ docker run -it --rm -v $PWD :/lab throwtheswitch/drsurly-course1:latest
Original file line number Diff line number Diff line change
1
+ docker run -it --rm -v " %cd% " :/lab throwtheswitch/drsurly-course1:latest
You can’t perform that action at this time.
0 commit comments