回答編集履歴
2
Add test
answer
CHANGED
@@ -18,4 +18,41 @@
|
|
18
18
|
RUN apk --no-cache add nodejs-npm
|
19
19
|
```
|
20
20
|
|
21
|
+
動作確認:
|
22
|
+
|
23
|
+
```console
|
24
|
+
$ docker build . --tag futureys/ruby-node:latest
|
25
|
+
|
26
|
+
--- 略 ---
|
27
|
+
|
28
|
+
Step 4/4 : RUN apk --no-cache add nodejs-npm
|
29
|
+
---> Running in 5b8d09e7147a
|
30
|
+
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
|
31
|
+
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
|
32
|
+
(1/9) Installing c-ares (1.13.0-r0)
|
33
|
+
(2/9) Installing libcrypto1.0 (1.0.2t-r0)
|
34
|
+
(3/9) Installing libgcc (6.4.0-r5)
|
35
|
+
(4/9) Installing http-parser (2.7.1-r1)
|
36
|
+
(5/9) Installing libssl1.0 (1.0.2t-r0)
|
37
|
+
(6/9) Installing libstdc++ (6.4.0-r5)
|
38
|
+
(7/9) Installing libuv (1.17.0-r0)
|
39
|
+
(8/9) Installing nodejs (8.9.3-r1)
|
40
|
+
(9/9) Installing nodejs-npm (8.9.3-r1)
|
41
|
+
Executing busybox-1.27.2-r11.trigger
|
42
|
+
OK: 71 MiB in 39 packages
|
43
|
+
Removing intermediate container 5b8d09e7147a
|
44
|
+
---> 95bca61cdf89
|
45
|
+
Successfully built 95bca61cdf89
|
46
|
+
Successfully tagged futureys/ruby-node:latest
|
47
|
+
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
|
48
|
+
|
49
|
+
$ docker run --rm -it futureys/ruby-node:latest
|
50
|
+
irb(main):001:0> npm --version
|
51
|
+
Traceback (most recent call last):
|
52
|
+
2: from /usr/local/bin/irb:11:in `<main>'
|
53
|
+
1: from (irb):1
|
54
|
+
NameError (undefined local variable or method `version' for main:Object)
|
55
|
+
irb(main):002:0>
|
56
|
+
```
|
57
|
+
|
21
58
|
参考: [Answer: How to install npm in alpine linux](https://superuser.com/a/1187246/1167741)
|
1
Fix Dockerfile
answer
CHANGED
@@ -4,7 +4,18 @@
|
|
4
4
|
依存関係の管理はパッケージマネージャーにまかせましょう:
|
5
5
|
|
6
6
|
```dockerfile
|
7
|
+
FROM ruby:2.5.1-alpine as builder
|
8
|
+
|
9
|
+
ENV ENTRYKIT_VERSION 0.4.0
|
10
|
+
|
11
|
+
RUN wget https://github.com/progrium/entrykit/releases/download/v${ENTRYKIT_VERSION}/entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
|
12
|
+
&& tar -xvzf entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
|
13
|
+
&& rm entrykit_${ENTRYKIT_VERSION}_Linux_x86_64.tgz \
|
14
|
+
&& mv entrykit /bin/entrykit \
|
15
|
+
&& chmod +x /bin/entrykit \
|
16
|
+
&& entrykit --symlink
|
17
|
+
# 次の行を追加します
|
7
|
-
RUN apk
|
18
|
+
RUN apk --no-cache add nodejs-npm
|
8
19
|
```
|
9
20
|
|
10
|
-
参考: [Answer: How to install npm in alpine linux](https://superuser.com/a/
|
21
|
+
参考: [Answer: How to install npm in alpine linux](https://superuser.com/a/1187246/1167741)
|