質問編集履歴

2

書き方を修正しました。

2019/08/28 13:22

投稿

ruuusaamarki
ruuusaamarki

スコア468

test CHANGED
File without changes
test CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
 
20
20
 
21
- ```NG-Dockerfile
21
+ ```Dockerfile
22
22
 
23
23
 
24
24
 
@@ -38,7 +38,7 @@
38
38
 
39
39
  以下のように修正したらコンテナが立ち上がってきた。
40
40
 
41
- ```OK-Dockerfile
41
+ ```Dockerfile
42
42
 
43
43
 
44
44
 
@@ -122,7 +122,7 @@
122
122
 
123
123
 
124
124
 
125
- ```docker-compose.yml
125
+ ```yml
126
126
 
127
127
 
128
128
 
@@ -152,7 +152,7 @@
152
152
 
153
153
 
154
154
 
155
- ```build.sh
155
+ ```shell
156
156
 
157
157
 
158
158
 
@@ -302,7 +302,7 @@
302
302
 
303
303
 
304
304
 
305
- ```up.sh
305
+ ```shell
306
306
 
307
307
 
308
308
 
@@ -354,7 +354,7 @@
354
354
 
355
355
 
356
356
 
357
- ```exec.sh
357
+ ```shell
358
358
 
359
359
 
360
360
 

1

環境、テストしたことを追記しました。

2019/08/28 13:22

投稿

ruuusaamarki
ruuusaamarki

スコア468

test CHANGED
File without changes
test CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
 
10
10
 
11
+ ### 環境
12
+
13
+ docker-machine上にて環境を構築しています。
14
+
15
+
16
+
11
17
  ### 起こった問題のソース
12
18
 
13
19
 
@@ -75,3 +81,293 @@
75
81
  ヒントだけでもいただけましたら嬉しく思います。
76
82
 
77
83
  よろしくお願いいたします。
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+ ### テスト2回目結果
94
+
95
+
96
+
97
+ ```Dockerfile
98
+
99
+
100
+
101
+ FROM nginx:mainline-alpine
102
+
103
+ RUN apk update; \
104
+
105
+ apk add nodejs npm; \
106
+
107
+ npm install -g browserify; \
108
+
109
+ npm install -g babel-cli; \
110
+
111
+ apk add git;
112
+
113
+ WORKDIR /app
114
+
115
+ EXPOSE 8080
116
+
117
+ CMD nginx -g "daemon off;"
118
+
119
+
120
+
121
+ ```
122
+
123
+
124
+
125
+ ```docker-compose.yml
126
+
127
+
128
+
129
+ version: '3.7'
130
+
131
+ services:
132
+
133
+ webserver:
134
+
135
+ build: ./
136
+
137
+ container_name: nginx
138
+
139
+ tty: true
140
+
141
+ volumes:
142
+
143
+ - ./app:/app
144
+
145
+ ports:
146
+
147
+ - "8080:80"
148
+
149
+
150
+
151
+ ```
152
+
153
+
154
+
155
+ ```build.sh
156
+
157
+
158
+
159
+ $ docker-compose build --no-cache
160
+
161
+ Building webserver
162
+
163
+ Step 1/5 : FROM nginx:mainline-alpine
164
+
165
+ mainline-alpine: Pulling from library/nginx
166
+
167
+ 9d48c3bd43c5: Pull complete
168
+
169
+ b6dac14ba0a9: Pull complete
170
+
171
+ Status: Downloaded newer image for nginx:mainline-alpine
172
+
173
+ Step 2/5 : RUN apk update; apk add nodejs npm; npm install -g browserify; npm install -g babel-cli; apk add git;
174
+
175
+ fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
176
+
177
+ fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
178
+
179
+ v3.10.2-19 [http://dl-cdn.alpinelinux.org/alpine/v3.10/main]
180
+
181
+ v3.10.2-2 [http://dl-cdn.alpinelinux.org/alpine/v3.10/community]
182
+
183
+ OK: 10339 distinct packages available
184
+
185
+ (1/8) Installing ca-certificates (20190108-r0)
186
+
187
+ (2/8) Installing c-ares (1.15.0-r0)
188
+
189
+ (3/8) Installing libgcc (8.3.0-r0)
190
+
191
+ (4/8) Installing http-parser (2.9.2-r0)
192
+
193
+ (5/8) Installing libstdc++ (8.3.0-r0)
194
+
195
+ (6/8) Installing libuv (1.29.1-r0)
196
+
197
+ (7/8) Installing nodejs (10.16.3-r0)
198
+
199
+ (8/8) Installing npm (10.16.3-r0)
200
+
201
+ Executing busybox-1.30.1-r2.trigger
202
+
203
+ Executing ca-certificates-20190108-r0.trigger
204
+
205
+ OK: 82 MiB in 45 packages
206
+
207
+ npm ERR! code ENOTFOUND
208
+
209
+ npm ERR! errno ENOTFOUND
210
+
211
+ npm ERR! network request to https://registry.npmjs.org/cached-path-relative failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
212
+
213
+ npm ERR! network This is a problem related to network connectivity.
214
+
215
+ npm ERR! network In most cases you are behind a proxy or have bad network settings.
216
+
217
+ npm ERR! network
218
+
219
+ npm ERR! network If you are behind a proxy, please make sure that the
220
+
221
+ npm ERR! network 'proxy' config is set properly. See: 'npm help config'
222
+
223
+
224
+
225
+ npm ERR! A complete log of this run can be found in:
226
+
227
+ npm ERR! /root/.npm/_logs/2019-08-28T12_45_46_775Z-debug.log
228
+
229
+ npm ERR! code ENOTFOUND
230
+
231
+ npm ERR! errno ENOTFOUND
232
+
233
+ npm ERR! network request to https://registry.npmjs.org/fs-readdir-recursive failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
234
+
235
+ npm ERR! network This is a problem related to network connectivity.
236
+
237
+ npm ERR! network In most cases you are behind a proxy or have bad network settings.
238
+
239
+ npm ERR! network
240
+
241
+ npm ERR! network If you are behind a proxy, please make sure that the
242
+
243
+ npm ERR! network 'proxy' config is set properly. See: 'npm help config'
244
+
245
+
246
+
247
+ npm ERR! A complete log of this run can be found in:
248
+
249
+ npm ERR! /root/.npm/_logs/2019-08-28debug.log
250
+
251
+ (1/5) Installing nghttp2-libs (1.39.2-r0)
252
+
253
+ (2/5) Installing libcurl (7.65.1-r0)
254
+
255
+ (3/5) Installing expat (2.2.7-r0)
256
+
257
+ (4/5) Installing pcre2 (10.33-r0)
258
+
259
+ (5/5) Installing git (2.22.0-r0)
260
+
261
+ Executing busybox-1.30.1-r2.trigger
262
+
263
+ OK: 96 MiB in 50 packages
264
+
265
+ Removing intermediate container
266
+
267
+ --->
268
+
269
+ Step 3/5 : WORKDIR /app/reactbeginnersguide
270
+
271
+ ---> Running in
272
+
273
+ Removing intermediate container 0
274
+
275
+ --->
276
+
277
+ Step 4/5 : EXPOSE 8080
278
+
279
+ ---> Running in
280
+
281
+ Removing intermediate container
282
+
283
+ --->
284
+
285
+ Step 5/5 : CMD nginx -g "daemon off;"
286
+
287
+ ---> Running in
288
+
289
+ Removing intermediate container
290
+
291
+ --->
292
+
293
+
294
+
295
+ Successfully built
296
+
297
+ Successfully tagged react_webserver:latest
298
+
299
+
300
+
301
+ ```
302
+
303
+
304
+
305
+ ```up.sh
306
+
307
+
308
+
309
+ $docker-compose up -d --build
310
+
311
+ Creating network "react_default" with the default driver
312
+
313
+ Building webserver
314
+
315
+ Step 1/5 : FROM nginx:mainline-alpine
316
+
317
+ --->
318
+
319
+ Step 2/5 : RUN apk update; apk add nodejs npm; npm install -g browserify; npm install -g babel-cli; apk add git;
320
+
321
+ ---> Using cache
322
+
323
+ --->
324
+
325
+ Step 3/5 : WORKDIR /app/react
326
+
327
+ ---> Using cache
328
+
329
+ --->
330
+
331
+ Step 4/5 : EXPOSE 8080
332
+
333
+ ---> Using cache
334
+
335
+ --->
336
+
337
+ Step 5/5 : CMD nginx -g "daemon off;"
338
+
339
+ ---> Using cache
340
+
341
+ --->
342
+
343
+
344
+
345
+ Successfully built
346
+
347
+ Successfully tagged react_webserver:latest
348
+
349
+ Creating nginx ... done
350
+
351
+
352
+
353
+ ```
354
+
355
+
356
+
357
+ ```exec.sh
358
+
359
+
360
+
361
+ $docker exec -it nginx /bin/sh
362
+
363
+ /app # browserify --version
364
+
365
+ /bin/sh: browserify: not found
366
+
367
+ /app # babel --version
368
+
369
+ /bin/sh: babel: not found
370
+
371
+
372
+
373
+ ```