Use explicit version tag in Dockerfile #854

Merged
merged 5 commits into from Dec 3, 2016

Projects

None yet

2 participants

@mauricedb
Contributor

Fixes #851.

Summary of the changes in this PR:

  • Use an explicit CLR version tag in the Dockerfile
  • Make sure the CLR version used in the project.json and Dockerfile match

Thanks!

/cc
@OmniSharp/generator-aspnet-team-push

@peterblazejewicz

The users would get: invalid reference format with dotnet:dotnet:1.1.0-sdk-projectjson

templates/Dockerfile.txt
@@ -1,4 +1,4 @@
-FROM microsoft/dotnet:latest
+FROM microsoft/dotnet:dotnet:1.1.0-sdk-projectjson
@peterblazejewicz
peterblazejewicz Dec 2, 2016 edited Contributor

There is a typo I believe here. Should be:

FROM microsoft/dotnet:1.1.0-sdk-projectjson

😄

test/subgenerators.js
+ util.goCreateWithArgs('mvccontroller', [arg], path.join(dir, 'webTest'));
+
+ util.fileContentCheck('project.json', 'file content check', new RegExp('"Microsoft.NETCore.App":\\s*{\\s*"version": "' + sdkVersion + '"'));
+ util.fileContentCheck('Dockerfile', 'Check the content for dotnet latest image tag', new RegExp('FROM microsoft\/dotnet:dotnet:' + sdkVersion + '-sdk-projectjson'));
@peterblazejewicz
peterblazejewicz Dec 2, 2016 Contributor

again, should be:

'FROM microsoft\/dotnet:'
test/subgenerators.js
@@ -99,7 +111,7 @@ describe('Subgenerators without arguments tests', function() {
var filename = 'Dockerfile';
util.goCreate(filename.toLowerCase());
util.fileCheck('should create Dockerfile', filename);
- util.fileContentCheck(filename, 'Check the content for dotnet latest image tag', /FROM microsoft\/dotnet:latest/);
+ util.fileContentCheck(filename, 'Check the content for dotnet latest image tag', /FROM microsoft\/dotnet:dotnet:/);
@peterblazejewicz
peterblazejewicz Dec 2, 2016 Contributor

As above 'FROM microsoft\/dotnet:'

test/subgenerators.js
@@ -109,7 +121,7 @@ describe('Subgenerators without arguments tests', function() {
var filename = 'Dockerfile';
util.goCreateWithArgs(filename.toLowerCase(), [arg]);
util.fileCheck('should create Dockerfile', filename);
- util.fileContentCheck(filename, 'Check the content for dotnet latest image tag', /FROM microsoft\/dotnet:latest/);
+ util.fileContentCheck(filename, 'Check the content for dotnet latest image tag', /FROM microsoft\/dotnet:dotnet:/);
@peterblazejewicz
peterblazejewicz Dec 2, 2016 Contributor

and last one 'FROM microsoft\/dotnet:'

@mauricedb
Contributor

@peterblazejewicz

Oops copy and fail error with the dotnet:dotnet: :-(

I also added the Windows Nano Server dockerfile under Dockerfile.nano

However I am unsure about the dockerfile sub generator. I could add it there so it would add two files, one for Linux and one for Windows Nano. Else I could create a new sub generator dockerfilenano. But the --sqlite feels bit weird as it has nothing to do with SQLite but runs an EF database update.

@peterblazejewicz
Contributor

However I am unsure about the dockerfile sub generator. I could add it there so it would add two files, one for Linux and one for Windows Nano. Else I could create a new sub generator dockerfilenano. But the --sqlite feels bit weird as it has nothing to do with SQLite but runs an EF database update.

Let's left it as is - as Docker support and usage becomes more mature it will be very likely done here by someone or by other repo with templates. The most important are correct images at the moment and they work. Here is screen from build and run image:

image

Thanks!

@peterblazejewicz peterblazejewicz merged commit 20b75f3 into OmniSharp:master Dec 3, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment