File tree 7 files changed +48
-14
lines changed
7 files changed +48
-14
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ DOTNET_CONFIGURATION="${DOTNET_CONFIGURATION:-Release}"
8
8
if [ -z ${DOTNET_STARTUP_PROJECT+x} ]; then
9
9
DOTNET_STARTUP_PROJECT=" ."
10
10
fi
11
- DOTNET_FRAMEWORK=" netcoreapp2.0"
12
11
13
12
# Build nuget sources list for when doing the restore
14
13
RESTORE_OPTIONS=" "
Original file line number Diff line number Diff line change @@ -42,9 +42,6 @@ if [ "$DOTNET_ASPNET_STORE" != "false" ]; then
42
42
DOTNET_ASPNET_STORE=" true"
43
43
fi
44
44
45
- # Private environment
46
- DOTNET_FRAMEWORK=" netcoreapp2.0"
47
-
48
45
# Ensure there is a project file and derive assembly name from project name.
49
46
PROJFILES=(` find " ${DOTNET_STARTUP_PROJECT} " -maxdepth 1 -name " *.??proj" ` )
50
47
if [ ${# PROJFILES[@]} -eq 1 ]; then
Original file line number Diff line number Diff line change 14
14
#
15
15
# Example usage: $ sudo ./test/run
16
16
17
- IMAGE_NAME=${IMAGE_NAME:- dotnet/ dotnet-20-rhel7}
18
- RUNTIME_IMAGE_NAME=${RUNTIME_IMAGE_NAME:- dotnet/ dotnet-20-runtime-rhel7}
17
+ if [ " $BUILD_CENTOS " = " true" ]; then
18
+ IMAGE_NAME=${IMAGE_NAME:- centos/ dotnet-20-centos7}
19
+ RUNTIME_IMAGE_NAME=${RUNTIME_IMAGE_NAME:- centos/ dotnet-20-runtime-centos7}
20
+ else
21
+ IMAGE_NAME=${IMAGE_NAME:- dotnet/ dotnet-20-rhel7}
22
+ RUNTIME_IMAGE_NAME=${RUNTIME_IMAGE_NAME:- dotnet/ dotnet-20-runtime-rhel7}
23
+ fi
19
24
OPENSHIFT_ONLY=${OPENSHIFT_ONLY:- false}
20
25
21
26
test_dir=" $( readlink -zf $( dirname " ${BASH_SOURCE[0]} " ) ) "
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ FROM centos:7
4
4
5
5
EXPOSE 8080
6
6
7
- ENV DOTNET_CORE_VERSION=2.0
8
-
9
7
# Default to UTF-8 file.encoding
10
8
ENV LANG=C.UTF-8 \
11
9
HOME=/opt/app-root \
12
10
PATH=/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
13
11
DOTNET_APP_PATH=/opt/app-root/app \
14
- DOTNET_DEFAULT_CMD=default-cmd.sh
12
+ DOTNET_DEFAULT_CMD=default-cmd.sh \
13
+ DOTNET_CORE_VERSION=2.0 \
14
+ DOTNET_FRAMEWORK=netcoreapp2.0
15
15
16
16
LABEL io.k8s.description="Platform for running .NET Core 2.0 applications" \
17
17
io.k8s.display-name=".NET Core 2.0" \
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ FROM rhel7
4
4
5
5
EXPOSE 8080
6
6
7
- ENV DOTNET_CORE_VERSION=2.0
8
-
9
7
# Default to UTF-8 file.encoding
10
8
ENV LANG=C.UTF-8 \
11
9
HOME=/opt/app-root \
12
10
PATH=/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
13
11
DOTNET_APP_PATH=/opt/app-root/app \
14
- DOTNET_DEFAULT_CMD=default-cmd.sh
12
+ DOTNET_DEFAULT_CMD=default-cmd.sh \
13
+ DOTNET_CORE_VERSION=2.0 \
14
+ DOTNET_FRAMEWORK=netcoreapp2.0
15
15
16
16
LABEL io.k8s.description="Platform for running .NET Core 2.0 applications" \
17
17
io.k8s.display-name=".NET Core 2.0" \
Original file line number Diff line number Diff line change @@ -64,7 +64,18 @@ Repository organization
64
64
Environment variables
65
65
---------------------
66
66
67
+ The following variables are set so they can be used from scripts.
68
+ They must not to be overridden.
69
+
67
70
* ** ASPNETCORE_URLS**
68
71
69
72
This variable is set to ` http://*:8080 ` to configure ASP.NET Core to use the
70
73
port exposed by the image.
74
+
75
+ * ** DOTNET_APP_PATH,DOTNET_DEFAULT_CMD**
76
+
77
+ These variables contain the working directory (` /opt/app-root/app ` ) and default CMD of the runtime image (` default-cmd.sh ` ).
78
+
79
+ * ** DOTNET_FRAMEWORK,DOTNET_CORE_VERSION**
80
+
81
+ These variables contain the framework (` netcoreapp2.0 ` ) and .NET Core version (` 2.0 ` ) respectively.
Original file line number Diff line number Diff line change 11
11
#
12
12
# Example usage: $ sudo ./test/run
13
13
14
- IMAGE_NAME=${IMAGE_NAME:- dotnet/ dotnet-20-runtime-rhel7}
14
+ if [ " $BUILD_CENTOS " = " true" ]; then
15
+ IMAGE_NAME=${IMAGE_NAME:- centos/ dotnet-20-runtime-centos7}
16
+ else
17
+ IMAGE_NAME=${IMAGE_NAME:- dotnet/ dotnet-20-runtime-rhel7}
18
+ fi
15
19
OPENSHIFT_ONLY=${OPENSHIFT_ONLY:- false}
16
20
17
21
test_dir=" $( readlink -zf $( dirname " ${BASH_SOURCE[0]} " ) ) "
18
22
source ${test_dir} /testcommon
19
23
24
+ dotnet_version_series=" 2.0"
25
+ dotnet_version_suffix=" 0"
26
+ dotnet_version=" ${dotnet_version_series} .${dotnet_version_suffix} "
27
+
20
28
test_dotnet () {
21
29
test_start
22
- local dotnet_version=" 2.0.0"
23
30
24
31
# ENTRYPOINT enables scl so dotnet is available
25
32
assert_contains " $( docker_run $IMAGE_NAME " dotnet --info" ) " " Microsoft .NET Core Shared Framework Host"
@@ -28,6 +35,20 @@ test_dotnet() {
28
35
assert_contains " $( docker_run $IMAGE_NAME " dotnet --info" ) " " Version : ${dotnet_version} " $' \r\n '
29
36
}
30
37
38
+ test_envvars () {
39
+ test_start
40
+
41
+ # DOTNET_APP_PATH
42
+ assert_equal $( docker_get_env $IMAGE_NAME DOTNET_APP_PATH) " /opt/app-root/app"
43
+ # DOTNET_DEFAULT_CMD
44
+ assert_equal $( docker_get_env $IMAGE_NAME DOTNET_DEFAULT_CMD) " default-cmd.sh"
45
+
46
+ # DOTNET_CORE_VERSION
47
+ assert_equal $( docker_get_env $IMAGE_NAME DOTNET_CORE_VERSION) " ${dotnet_version_series} "
48
+ # DOTNET_FRAMEWORK
49
+ assert_equal $( docker_get_env $IMAGE_NAME DOTNET_FRAMEWORK) " netcoreapp${dotnet_version_series} "
50
+ }
51
+
31
52
test_debuggable () {
32
53
test_start
33
54
@@ -99,6 +120,7 @@ info "Testing ${IMAGE_NAME}"
99
120
100
121
if [ ${OPENSHIFT_ONLY} != true ]; then
101
122
test_dotnet
123
+ test_envvars
102
124
test_default_cmd
103
125
test_debuggable
104
126
test_user
You can’t perform that action at this time.
0 commit comments