Skip to content
This repository was archived by the owner on Feb 13, 2019. It is now read-only.
Closed
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
4 changes: 1 addition & 3 deletions Dockerfile/USAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Description:
Creates a new Docker configuration file.
By default Mono-based definition file is created.
To create CoreCLR based definition file use --coreclr option

Example:
yo aspnet:Dockerfile [--coreclr]
yo aspnet:Dockerfile

This will create:
Dockerfile
8 changes: 2 additions & 6 deletions Dockerfile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ var Generator = module.exports = function Generator() {
util.inherits(Generator, ScriptBase);

Generator.prototype.createItem = function() {
// support CoreCLR runtime version of Docker image
// is provided by --coreclr option
this.generateTemplateFile(
'Dockerfile.txt',
'Dockerfile', {
coreclr: (this.options.coreclr) ? this.options.coreclr : false
});
'Dockerfile.txt',
'Dockerfile');
};
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ Produces `filename.coffee`
### Dockerfile

Creates a new Docker configuration file.
By default `Mono` based definition file is created.
To create `CoreCLR` based definition file use `--coreclr` option

Example:
```
Expand Down
6 changes: 3 additions & 3 deletions templates/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<% if(!coreclr){ %>FROM microsoft/aspnet:1.0.0-rc1-update1<% } %><% if(coreclr){ %>FROM microsoft/aspnet:1.0.0-rc1-update1-coreclr<% } %>
FROM microsoft/dotnet:1.0.0-rc2-core

RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list
RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*

COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
RUN ["dotnet", "restore"]

EXPOSE 5000/tcp
ENTRYPOINT ["dnx", "-p", "project.json", "Microsoft.AspNet.Server.Kestrel", "--server.urls", "http://0.0.0.0:5000"]
ENTRYPOINT ["dotnet", "run", "-p", "project.json"]
12 changes: 2 additions & 10 deletions test/subgenerators.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,11 @@ describe('Subgenerators without arguments tests', function() {
util.fileCheck('should create tsconfig.json file', 'tsconfig.json');
});

describe('aspnet:Dockerfile Mono-based', function() {
describe('aspnet:Dockerfile', function() {
var filename = 'Dockerfile';
util.goCreate(filename);
util.fileCheck('should create Dockerfile', filename);
util.fileContentCheck(filename, 'Check the content for Mono-based image tag', /FROM microsoft\/aspnet:1\.0\.0-rc1-update1/);
});

describe('aspnet:Dockerfile CoreCLR-based', function() {
var arg = '--coreclr';
var filename = 'Dockerfile';
util.goCreateWithArgs(filename, [arg]);
util.fileCheck('should create Dockerfile', filename);
util.fileContentCheck(filename, 'Check the content for CoreCLR-based image tag', /FROM microsoft\/aspnet:1\.0\.0-rc1-update1-coreclr/);
util.fileContentCheck(filename, 'Check the content for dotnet image tag', /FROM microsoft\/dotnet:1\.0\.0-rc2-core/);
});

describe('aspnet:nuget', function() {
Expand Down