Skip to content

Commit 30e6742

Browse files
authored
Update base image and split Dockerfiles (#11)
1 parent f74e3c6 commit 30e6742

12 files changed

+66
-20
lines changed

app/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,12 @@ module.exports = class extends Generator {
6868

6969
this._copyStatic('gitignore', '.gitignore');
7070
this._copyStatic('app.js');
71-
this._copyStatic('Dockerfile');
71+
this._copyStatic('Dockerfile.amd64');
72+
this._copyStatic('Dockerfile.amd64.debug');
7273
this._copyStatic('Dockerfile.arm32v7');
74+
this._copyStatic('Dockerfile.arm32v7.debug');
7375
this._copyStatic('Dockerfile.windows-amd64');
76+
this._copyStatic('Dockerfile.windows-amd64.debug');
7477

7578
this._copyTemplate('module.json', { repository: this.repository });
7679
this._copyTemplate('package.json', { name: this.name })
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:8-slim
1+
FROM node:8-alpine
22

33
WORKDIR /app/
44

@@ -10,6 +10,4 @@ COPY app.js ./
1010

1111
USER node
1212

13-
ENV DEBUG_OPTION " "
14-
15-
CMD ["sh", "-c", "node $DEBUG_OPTION app.js"]
13+
CMD ["node, "app.js"]

app/templates/Dockerfile.amd64.debug

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:8-alpine
2+
3+
WORKDIR /app/
4+
5+
COPY package*.json ./
6+
7+
RUN npm install --production
8+
9+
COPY app.js ./
10+
11+
USER node
12+
13+
CMD ["node", "--inspect=0.0.0.0:9229", "app.js"]

app/templates/Dockerfile.arm32v7

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM arm32v7/node:8
1+
FROM arm32v7/node:8-slim
22

33
WORKDIR /app/
44

@@ -10,6 +10,4 @@ COPY app.js ./
1010

1111
USER node
1212

13-
ENV DEBUG_OPTION " "
14-
15-
CMD ["sh", "-c", "node $DEBUG_OPTION app.js"]
13+
CMD ["node, "app.js"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM arm32v7/node:8-slim
2+
3+
WORKDIR /app/
4+
5+
COPY package*.json ./
6+
7+
RUN npm install --production
8+
9+
COPY app.js ./
10+
11+
USER node
12+
13+
CMD ["node", "--inspect=0.0.0.0:9229", "app.js"]

app/templates/Dockerfile.windows-amd64

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@ RUN npm install --production
88

99
COPY app.js ./
1010

11-
ENV DEBUG_OPTION " "
12-
13-
CMD ["cmd", "/C", "node %DEBUG_OPTION% app.js"]
11+
CMD ["node, "app.js"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM stefanscherer/node-windows:8-nanoserver
2+
3+
WORKDIR /app/
4+
5+
COPY package*.json ./
6+
7+
RUN npm install --production
8+
9+
COPY app.js ./
10+
11+
CMD ["node", "--inspect=0.0.0.0:9229", "app.js"]

app/templates/module.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
"tag": {
77
"version": "0.0.1",
88
"platforms": {
9-
"amd64": "./Dockerfile",
9+
"amd64": "./Dockerfile.amd64",
10+
"amd64.debug": "./Dockerfile.amd64.debug",
1011
"arm32v7": "./Dockerfile.arm32v7",
11-
"windows-amd64": "./Dockerfile.windows-amd64"
12+
"arm32v7.debug": "./Dockerfile.arm32v7.debug",
13+
"windows-amd64": "./Dockerfile.windows-amd64",
14+
"windows-amd64.debug": "./Dockerfile.windows-amd64.debug"
1215
}
1316
},
1417
"buildOptions": []

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-azure-iot-edge-module",
3-
"version": "1.0.0-rc3",
3+
"version": "1.0.0-rc4",
44
"description": "Yeoman generator for Azure IoT Edge Node module",
55
"files": [
66
"app"

0 commit comments

Comments
 (0)