Skip to content

Commit 5ed6e3d

Browse files
authored
* Add apt-get upgrade to always install latest security fixes during every image build. (#50)
This is done to always have an up to date image even when the base image is not updated for some reason. * Cleanup apt data once they are not required anymore.
1 parent 98a23d4 commit 5ed6e3d

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

core/ruby2.5Action/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919

2020
# Ruby 2.5 OpenWhisk Runtime Container
2121

22+
## Next Release
23+
- Install latest security fixes with every image build.
24+
2225
## 1.15.0
2326
- Build proxy using golang 1.15 and openwhisk-runtime-go 1.16.0 (#48)
2427

core/ruby2.5Action/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,16 @@ RUN gem install \
2727
activesupport `#optional` \
2828
jwt `#optional`
2929

30-
# create src directory to store action files
31-
RUN mkdir -p /action/src
30+
31+
RUN \
32+
apt-get -y update \
33+
# Upgrade installed packages to get latest security fixes if the base image does not contain them already.
34+
&& apt-get upgrade -y --no-install-recommends \
35+
# Cleanup apt data, we do not need them later on.
36+
&& rm -rf /var/lib/apt/lists/* \
37+
# create src directory to store action files
38+
&& mkdir -p /action/src
39+
3240
ADD rackapp /action/rackapp/
3341
COPY config.ru /action
3442

core/ruby2.6ActionLoop/CHANGELOG.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919

2020
# Ruby 2.6 OpenWhisk Runtime Container
2121

22+
## Next Release
23+
- Install latest security fixes with every image build.
24+
2225
## 1.15.0
2326
- Build proxy using golang 1.15 and openwhisk-runtime-go 1.16.0 (#48)
2427

core/ruby2.6ActionLoop/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ FROM ruby:2.6
3333
# select the builder to use
3434
ARG GO_PROXY_BUILD_FROM=release
3535

36-
RUN mkdir -p /proxy/bin /proxy/lib /proxy/action
36+
RUN \
37+
apt-get -y update \
38+
# Upgrade installed packages to get latest security fixes if the base image does not contain them already.
39+
&& apt-get upgrade -y --no-install-recommends \
40+
# Cleanup apt data, we do not need them later on.
41+
&& rm -rf /var/lib/apt/lists/* \
42+
# Create required directories
43+
&& mkdir -p /proxy/bin /proxy/lib /proxy/action
44+
3745
WORKDIR /proxy
3846
COPY --from=builder_source /bin/proxy /bin/proxy_source
3947
COPY --from=builder_release /bin/proxy /bin/proxy_release

0 commit comments

Comments
 (0)