Skip to content

Commit 0f1e4b9

Browse files
committed
Update Dockerfile example
- Explicit image tag - Alpine image - `maintainer` LABEL - Caching of dependencies
1 parent 55da059 commit 0f1e4b9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

SPEC.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,21 +325,25 @@ the builds of these images. The `Dockerfile` must follow these specifications:
325325
Here is an example of a `Dockerfile` that follows the specifications for an engine written in Node.js:
326326

327327
```
328-
FROM node
328+
FROM node:7.7-alpine
329329
330-
MAINTAINER Michael R. Bernstein
330+
LABEL maintainer "Your Name <[email protected]>"
331331
332-
RUN useradd -u 9000 -r -s /bin/false app
332+
WORKDIR /usr/src/app
333+
COPY package.json /usr/src/app/
333334
334-
RUN npm install glob
335+
RUN npm install
335336
336-
WORKDIR /code
337+
RUN adduser -u 9000 -D app
337338
COPY . /usr/src/app
339+
RUN chown -R app:app /usr/src/app
338340
339341
USER app
342+
340343
VOLUME /code
344+
WORKDIR /code
341345
342-
CMD ["/usr/src/app/bin/fixme"]
346+
CMD ["/usr/src/app/bin/your-engine"]
343347
```
344348

345349
## Naming convention

0 commit comments

Comments
 (0)