Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 974d0d8

Browse filesBrowse files
committed
Build base from scratch to make base image smalled
1 parent 1615cce commit 974d0d8
Copy full SHA for 974d0d8

File tree

Expand file treeCollapse file tree

4 files changed

+17
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+17
-6
lines changed
Open diff view settings
Collapse file

‎base/Dockerfile‎

Copy file name to clipboardExpand all lines: base/Dockerfile
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
FROM lambci/lambda-base:raw
1+
FROM scratch
2+
3+
# Docker doesn't support unpacking from remote URLs with ADD,
4+
# and we don't want to 'docker import' because we can't squash into a small layer
5+
# So this is expected to be downloaded from https://lambci.s3.amazonaws.com/fs/nodejs4.3.tgz
6+
ADD ./nodejs4.3.tgz /
27

38
ENV PATH=/usr/local/bin:/usr/bin/:/bin \
49
LD_LIBRARY_PATH=/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib \
@@ -18,6 +23,11 @@ ENV PATH=/usr/local/bin:/usr/bin/:/bin \
1823
AWS_XRAY_CONTEXT_MISSING=LOG_ERROR \
1924
_X_AMZN_TRACE_ID='Parent=11560be54abce8ed'
2025

21-
RUN mkdir /tmp && chown sbx_user1051:495 /tmp && chmod 700 /tmp
26+
RUN yum reinstall -y filesystem; \
27+
rm -rf /var/cache/yum /var/lib/rpm/__db.* /var/runtime /var/lang && \
28+
> /var/log/yum.log && \
29+
mkdir /tmp && \
30+
chown sbx_user1051:495 /tmp && \
31+
chmod 700 /tmp
2232

2333
WORKDIR /var/task
Collapse file

‎base/build/Dockerfile‎

Copy file name to clipboardExpand all lines: base/build/Dockerfile
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ yum_conf.write(f); \
1515
f.close();" && \
1616
rpm --rebuilddb && \
1717
yum install -y yum-plugin-ovl && \
18-
yum reinstall -y filesystem; \
19-
yum reinstall -y shadow-utils && \
18+
yum reinstall -y setup pam shadow-utils audit-libs glibc glibc-common openssl iptables && \
2019
yum groupinstall -y development && \
2120
yum install -y clang cmake aws-cli docker \
2221
openssl-devel libffi-devel python27-devel python34-devel \
Collapse file

‎base/create-base.sh‎

Copy file name to clipboard
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3-
curl https://lambci.s3.amazonaws.com/fs/nodejs4.3.tgz | gzip -d | docker import - lambci/lambda-base:raw
3+
curl -O https://lambci.s3.amazonaws.com/fs/nodejs4.3.tgz
44

55
docker build --squash -t lambci/lambda-base .
6+
7+
rm ./nodejs4.3.tgz
Collapse file

‎base/create-build.sh‎

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22

3-
docker build --pull --no-cache -t lambci/lambda-base:build -f ./build/Dockerfile .
3+
docker build --no-cache -t lambci/lambda-base:build -f ./build/Dockerfile .

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.