質問するログイン新規登録

質問編集履歴

4

質問文を修正

2021/10/20 05:26

投稿

akasatanaha
akasatanaha

スコア44

title CHANGED
File without changes
body CHANGED
@@ -52,86 +52,56 @@
52
52
  Serverless:
53
53
  Serverless: Packaging service...
54
54
  Serverless: Excluding development dependencies...
55
+ Sending build context to Docker daemon 290.4MB
56
+ Step 1/8 : FROM bref/php-80-fpm
57
+ ---> 540bd4e4f016
58
+ Step 2/8 : COPY . /var/task
59
+ ---> 163363282de0
60
+ Step 3/8 : RUN yum -y install aws-cli curl unzip
55
61
 
56
- Serverless Error ----------------------------------------
57
-
58
- Encountered error during executing: docker build -t serverless-laravel-dev:laravel -f /var/www/hogehoge/Dockerfile ./
59
- Output of the command:
60
- Sending build context to Docker daemon 290.4MB
61
- Step 1/8 : FROM bref/php-80-fpm
62
- ---> 540bd4e4f016
63
- Step 2/8 : COPY . /var/task
64
- ---> 9e340778075b
65
- Step 3/8 : RUN yum install aws-cli curl unzip
66
- ---> Running in ed00480f39c7
67
- Loaded plugins: ovl
68
- Resolving Dependencies
69
- --> Running transaction check
70
-
71
62
  ~~省略
72
63
 
73
- Dependencies Resolved
74
-
75
- ================================================================================
76
- Package Arch Version Repository Size
77
- ================================================================================
78
- Installing:
79
- awscli noarch 1.18.147-1.amzn2.0.1 amzn2-core 2.1 M
80
- unzip x86_64 6.0-43.amzn2 amzn2-core 179 k
81
- Updating:
82
- curl x86_64 7.76.1-7.amzn2.0.2 amzn2-core 345 k
83
- Installing for dependencies:
84
- PyYAML x86_64 3.10-11.amzn2.0.2 amzn2-core 181 k
85
- freetype x86_64 2.8-14.amzn2.1 amzn2-core 373 k
86
- groff-base x86_64 1.22.2-8.amzn2.0.2 amzn2-core 948 k
87
- jbigkit-libs x86_64 2.0-11.amzn2.0.2 amzn2-core 47 k
88
- libjpeg-turbo x86_64 2.0.90-2.amzn2.0.1 amzn2-core 170 k
89
- libpng x86_64 2:1.5.13-8.amzn2 amzn2-core 212 k
90
- libtiff x86_64 4.0.3-35.amzn2 amzn2-core 173 k
91
- libwebp x86_64 0.3.0-10.amzn2 amzn2-core 170 k
92
- libyaml x86_64 0.1.4-11.amzn2.0.2 amzn2-core 53 k
93
- python-backports x86_64 1.0-8.amzn2.0.2 amzn2-core 5.9 k
94
- python-backports-ssl_match_hostname
95
- noarch 3.5.0.1-1.amzn2 amzn2-core 13 k
96
- python-colorama noarch 0.3.2-3.amzn2 amzn2-core 25 k
97
- python-docutils noarch 0.12-0.2.20140510svn7747.amzn2 amzn2-core 1.5 M
98
- python-ipaddress noarch 1.0.16-2.amzn2 amzn2-core 34 k
99
- python-pillow x86_64 2.0.0-21.gitd1c6db8.amzn2.0.1 amzn2-core 440 k
100
- python-six noarch 1.9.0-2.amzn2 amzn2-core 29 k
101
- python-urllib3 noarch 1.25.9-1.amzn2.0.2 amzn2-core 191 k
102
- python2-botocore noarch 1.18.6-1.amzn2.0.1 amzn2-core 4.4 M
103
- python2-dateutil noarch 1:2.6.0-3.amzn2.0.1 amzn2-core 245 k
104
- python2-futures noarch 3.0.5-1.amzn2 amzn2-core 27 k
105
- python2-jmespath noarch 0.9.3-1.amzn2.0.1 amzn2-core 42 k
106
- python2-pyasn1 noarch 0.1.9-7.amzn2.0.1 amzn2-core 100 k
107
- python2-rsa noarch 3.4.1-1.amzn2.0.1 amzn2-core 68 k
108
- python2-s3transfer noarch 0.3.3-1.amzn2.0.1 amzn2-core 104 k
109
- python2-setuptools noarch 41.2.0-4.amzn2.0.2 amzn2-core 657 k
110
- Updating for dependencies:
111
- libcurl x86_64 7.76.1-7.amzn2.0.2 amzn2-core 314 k
112
-
113
- Transaction Summary
114
- ================================================================================
115
- Install 2 Packages (+25 Dependent packages)
116
- Upgrade 1 Package (+ 1 Dependent package)
117
-
118
- Total download size: 13 M
119
- Is this ok [y/d/N]: Exiting on user command
120
- Your transaction was saved, rerun it with:
121
- yum load-transaction /tmp/yum_save_tx.2021-10-19.09-48.ho4HVP.yumtx
122
- The command '/bin/sh -c yum install aws-cli curl unzip' returned a non-zero code: 1
123
-
124
-
125
- Get Support --------------------------------------------
126
- Docs: docs.serverless.com
127
- Bugs: github.com/serverless/serverless/issues
128
- Issues: forum.serverless.com
129
-
130
- Your Environment Information ---------------------------
131
- Operating System: linux
132
- Node Version: 10.19.0
133
- Framework Version: 2.56.0
134
- Plugin Version: 5.4.4
135
- SDK Version: 4.3.0
136
- Components Version: 3.16.0
137
- ```
64
+ Step 4/8 : RUN mkdir -p /opt
65
+ ---> Running in c603553f2e55
66
+ Removing intermediate container c603553f2e55
67
+ ---> c35462e37fd8
68
+ Step 5/8 : RUN curl $(AWS_DEFAULT_REGION=ap-northeast-1 AWS_ACCESS_KEY_ID=AKIA3DMDSKW5JOBBUJUV AWS_SECRET_ACCESS_KEY=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 aws lambda get-layer-version-by-arn --arn arn:aws:lambda:ap-northeast-1:763169494458:layer:php-gd:4 --query 'Content.Location' --output text) --output layer.zip
69
+ ---> Running in b13050df8a81
70
+ % Total % Received % Xferd Average Speed Time Time Time Current
71
+ Dload Upload Total Spent Left Speed
72
+ 100 686k 100 686k 0 0 1511k 0 --:--:-- --:--:-- --:--:-- 1508k
73
+ Removing intermediate container b13050df8a81
74
+ ---> 2060c52ff462
75
+ Step 6/8 : RUN unzip layer.zip -d /opt
76
+ ---> Running in 826814675f5d
77
+ Archive: layer.zip
78
+ inflating: /opt/bref/lib/php/extensions/no-debug-non-zts-20200930/gd.so
79
+ creating: /opt/bref/lib/x86_64-linux-gnu/
80
+ inflating: /opt/bref/lib/x86_64-linux-gnu/libgdbm_compat.so.4.0.0
81
+ inflating: /opt/bref/lib/x86_64-linux-gnu/libgdbm.so.6.0.0
82
+ inflating: /opt/bref/lib/x86_64-linux-gnu/libgd.so.3.0.8
83
+ inflating: /opt/bref/lib/x86_64-linux-gnu/libgdbm_compat.so.4
84
+ inflating: /opt/bref/lib/x86_64-linux-gnu/libgd.so.3
85
+ inflating: /opt/bref/lib/x86_64-linux-gnu/libgdbm.so.6
86
+ inflating: /opt/bref/lib/php/extensions/no-debug-non-zts-20200930/libgdbm_compat.so.4.0.0
87
+ inflating: /opt/bref/lib/php/extensions/no-debug-non-zts-20200930/libgdbm.so.6.0.0
88
+ inflating: /opt/bref/lib/php/extensions/no-debug-non-zts-20200930/libgd.so.3.0.8
89
+ inflating: /opt/bref/lib/php/extensions/no-debug-non-zts-20200930/libgdbm_compat.so.4
90
+ inflating: /opt/bref/lib/php/extensions/no-debug-non-zts-20200930/libgd.so.3
91
+ inflating: /opt/bref/lib/php/extensions/no-debug-non-zts-20200930/libgdbm.so.6
92
+ Removing intermediate container 826814675f5d
93
+ ---> 43589f96b25d
94
+ Step 7/8 : RUN rm layer.zip
95
+ ---> Running in 8cd540fdb6d9
96
+ Removing intermediate container 8cd540fdb6d9
97
+ ---> 94e4b766402a
98
+ Step 8/8 : CMD [ "public/index.php" ]
99
+ ---> Running in fbf556426956
100
+ Removing intermediate container fbf556426956
101
+ ---> 2f91c8be01c0
102
+ Successfully built 2f91c8be01c0
103
+ ```
104
+ ↑のログのStep6にてファイルが展開されていることが分かる。
105
+ また実際に該当ディレクトリにファイルがあるか確認したところ存在しました。
106
+ が、phpinfo()で確認したところ、gd は設定されていないとのこと。
107
+ なので、追加したレイヤー(gd レイヤー)が、正しいものではないようだ・・・

3

質問文を修正

2021/10/20 05:25

投稿

akasatanaha
akasatanaha

スコア44

title CHANGED
File without changes
body CHANGED
@@ -35,7 +35,7 @@
35
35
  ```ここに言語を入力
36
36
  FROM bref/php-80-fpm
37
37
  COPY . /var/task
38
- RUN yum install aws-cli curl unzip
38
+ RUN yum -y install aws-cli curl unzip
39
39
  RUN mkdir -p /opt
40
40
  RUN curl $(AWS_DEFAULT_REGION=ap-northeast-1 AWS_ACCESS_KEY_ID=xxxxxx AWS_SECRET_ACCESS_KEY=xxxxxx aws lambda get-layer-version-by-arn --arn arn:aws:lambda:hogehgoe:php-gd:1 --query 'Content.Location' --output text) --output layer.zip
41
41
  RUN unzip layer.zip -d /opt

2

質問文を修正

2021/10/19 12:13

投稿

akasatanaha
akasatanaha

スコア44

title CHANGED
File without changes
body CHANGED
@@ -37,7 +37,7 @@
37
37
  COPY . /var/task
38
38
  RUN yum install aws-cli curl unzip
39
39
  RUN mkdir -p /opt
40
- RUN curl $(aws lambda get-layer-version-by-arn --arn arn:aws:lambda:hogehgoe:php-gd:4 --query 'Content.Location' --output text) --output layer.zip
40
+ RUN curl $(AWS_DEFAULT_REGION=ap-northeast-1 AWS_ACCESS_KEY_ID=xxxxxx AWS_SECRET_ACCESS_KEY=xxxxxx aws lambda get-layer-version-by-arn --arn arn:aws:lambda:hogehgoe:php-gd:1 --query 'Content.Location' --output text) --output layer.zip
41
41
  RUN unzip layer.zip -d /opt
42
42
  RUN rm layer.zip
43
43
  CMD [ "public/index.php" ]

1

質問文を修正

2021/10/19 12:12

投稿

akasatanaha
akasatanaha

スコア44

title CHANGED
File without changes
body CHANGED
@@ -35,10 +35,103 @@
35
35
  ```ここに言語を入力
36
36
  FROM bref/php-80-fpm
37
37
  COPY . /var/task
38
- RUN /usr/bin/apt-get install aws-cli curl unzip
38
+ RUN yum install aws-cli curl unzip
39
39
  RUN mkdir -p /opt
40
40
  RUN curl $(aws lambda get-layer-version-by-arn --arn arn:aws:lambda:hogehgoe:php-gd:4 --query 'Content.Location' --output text) --output layer.zip
41
41
  RUN unzip layer.zip -d /opt
42
42
  RUN rm layer.zip
43
43
  CMD [ "public/index.php" ]
44
+ ```
45
+
46
+ # 実行後
47
+ ```ここに言語を入力
48
+ # sls deploy --stage dev
49
+ Serverless: Configuration warning at 'disabledDeprecations[0]': should match pattern "^[A-Z0-9_]+$"
50
+ Serverless:
51
+ Serverless: Learn more about configuration validation here: http://slss.io/configuration-validation
52
+ Serverless:
53
+ Serverless: Packaging service...
54
+ Serverless: Excluding development dependencies...
55
+
56
+ Serverless Error ----------------------------------------
57
+
58
+ Encountered error during executing: docker build -t serverless-laravel-dev:laravel -f /var/www/hogehoge/Dockerfile ./
59
+ Output of the command:
60
+ Sending build context to Docker daemon 290.4MB
61
+ Step 1/8 : FROM bref/php-80-fpm
62
+ ---> 540bd4e4f016
63
+ Step 2/8 : COPY . /var/task
64
+ ---> 9e340778075b
65
+ Step 3/8 : RUN yum install aws-cli curl unzip
66
+ ---> Running in ed00480f39c7
67
+ Loaded plugins: ovl
68
+ Resolving Dependencies
69
+ --> Running transaction check
70
+
71
+ ~~省略
72
+
73
+ Dependencies Resolved
74
+
75
+ ================================================================================
76
+ Package Arch Version Repository Size
77
+ ================================================================================
78
+ Installing:
79
+ awscli noarch 1.18.147-1.amzn2.0.1 amzn2-core 2.1 M
80
+ unzip x86_64 6.0-43.amzn2 amzn2-core 179 k
81
+ Updating:
82
+ curl x86_64 7.76.1-7.amzn2.0.2 amzn2-core 345 k
83
+ Installing for dependencies:
84
+ PyYAML x86_64 3.10-11.amzn2.0.2 amzn2-core 181 k
85
+ freetype x86_64 2.8-14.amzn2.1 amzn2-core 373 k
86
+ groff-base x86_64 1.22.2-8.amzn2.0.2 amzn2-core 948 k
87
+ jbigkit-libs x86_64 2.0-11.amzn2.0.2 amzn2-core 47 k
88
+ libjpeg-turbo x86_64 2.0.90-2.amzn2.0.1 amzn2-core 170 k
89
+ libpng x86_64 2:1.5.13-8.amzn2 amzn2-core 212 k
90
+ libtiff x86_64 4.0.3-35.amzn2 amzn2-core 173 k
91
+ libwebp x86_64 0.3.0-10.amzn2 amzn2-core 170 k
92
+ libyaml x86_64 0.1.4-11.amzn2.0.2 amzn2-core 53 k
93
+ python-backports x86_64 1.0-8.amzn2.0.2 amzn2-core 5.9 k
94
+ python-backports-ssl_match_hostname
95
+ noarch 3.5.0.1-1.amzn2 amzn2-core 13 k
96
+ python-colorama noarch 0.3.2-3.amzn2 amzn2-core 25 k
97
+ python-docutils noarch 0.12-0.2.20140510svn7747.amzn2 amzn2-core 1.5 M
98
+ python-ipaddress noarch 1.0.16-2.amzn2 amzn2-core 34 k
99
+ python-pillow x86_64 2.0.0-21.gitd1c6db8.amzn2.0.1 amzn2-core 440 k
100
+ python-six noarch 1.9.0-2.amzn2 amzn2-core 29 k
101
+ python-urllib3 noarch 1.25.9-1.amzn2.0.2 amzn2-core 191 k
102
+ python2-botocore noarch 1.18.6-1.amzn2.0.1 amzn2-core 4.4 M
103
+ python2-dateutil noarch 1:2.6.0-3.amzn2.0.1 amzn2-core 245 k
104
+ python2-futures noarch 3.0.5-1.amzn2 amzn2-core 27 k
105
+ python2-jmespath noarch 0.9.3-1.amzn2.0.1 amzn2-core 42 k
106
+ python2-pyasn1 noarch 0.1.9-7.amzn2.0.1 amzn2-core 100 k
107
+ python2-rsa noarch 3.4.1-1.amzn2.0.1 amzn2-core 68 k
108
+ python2-s3transfer noarch 0.3.3-1.amzn2.0.1 amzn2-core 104 k
109
+ python2-setuptools noarch 41.2.0-4.amzn2.0.2 amzn2-core 657 k
110
+ Updating for dependencies:
111
+ libcurl x86_64 7.76.1-7.amzn2.0.2 amzn2-core 314 k
112
+
113
+ Transaction Summary
114
+ ================================================================================
115
+ Install 2 Packages (+25 Dependent packages)
116
+ Upgrade 1 Package (+ 1 Dependent package)
117
+
118
+ Total download size: 13 M
119
+ Is this ok [y/d/N]: Exiting on user command
120
+ Your transaction was saved, rerun it with:
121
+ yum load-transaction /tmp/yum_save_tx.2021-10-19.09-48.ho4HVP.yumtx
122
+ The command '/bin/sh -c yum install aws-cli curl unzip' returned a non-zero code: 1
123
+
124
+
125
+ Get Support --------------------------------------------
126
+ Docs: docs.serverless.com
127
+ Bugs: github.com/serverless/serverless/issues
128
+ Issues: forum.serverless.com
129
+
130
+ Your Environment Information ---------------------------
131
+ Operating System: linux
132
+ Node Version: 10.19.0
133
+ Framework Version: 2.56.0
134
+ Plugin Version: 5.4.4
135
+ SDK Version: 4.3.0
136
+ Components Version: 3.16.0
44
137
  ```