Skip to content

Commit

Permalink
Add user to groups, bump watchdog version
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Stoekl <ems5311@gmail.com>
  • Loading branch information
ericstoekl committed Nov 27, 2017
1 parent d905bda commit 345fd09
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
9 changes: 6 additions & 3 deletions template/csharp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ COPY . .
RUN dotnet publish -c release -o published

FROM microsoft/dotnet:2.0-runtime
RUN useradd app
RUN addgroup -S app && adduser -S -g app app

RUN apt-get update -qy \
&& apt-get install -qy curl ca-certificates --no-install-recommends \
&& echo "Pulling watchdog binary from Github." \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.9/fwatchdog > /usr/bin/fwatchdog \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.12/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apt-get -qy remove curl \
&& apt-get clean \
Expand All @@ -32,7 +32,10 @@ RUN apt-get update -qy \
WORKDIR /home/app/
COPY --from=builder /home/app/src/published .

RUN chown -R app ./
# chmod for tmp is for a buildkit issue (@alexellis)
RUN chown app:app -R /home/app \
&& chmod 777 /tmp

USER app

ENV fprocess="dotnet ./root.dll"
Expand Down
2 changes: 1 addition & 1 deletion template/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN addgroup -S app && adduser -S -g app app
# Alternatively use ADD https:// (which will not be cached by Docker builder)
RUN apk --no-cache add curl \
&& echo "Pulling watchdog binary from Github." \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.9/fwatchdog > /usr/bin/fwatchdog \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.12/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl --no-cache

Expand Down
11 changes: 6 additions & 5 deletions template/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
FROM python:2.7-alpine

RUN adduser app -D
RUN addgroup -S app && adduser -S -g app app

# Alternatively use ADD https:// (which will not be cached by Docker builder)
RUN apk --no-cache add curl \
&& echo "Pulling watchdog binary from Github." \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.9/fwatchdog > /usr/bin/fwatchdog \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.12/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl --no-cache

RUN mkdir -p /home/app/function

COPY index.py /home/app
COPY requirements.txt /home/app

Expand All @@ -26,7 +24,10 @@ RUN pip install -r requirements.txt
WORKDIR /home/app
COPY function function

RUN chown -R app ./
# chmod for tmp is for a buildkit issue (@alexellis)
RUN chown app:app -R /home/app \
&& chmod 777 /tmp

USER app

ENV fprocess="python index.py"
Expand Down
9 changes: 6 additions & 3 deletions template/python3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM python:3-alpine

RUN adduser app -D
RUN addgroup -S app && adduser -S -g app app

# Alternatively use ADD https:// (which will not be cached by Docker builder)
RUN apk --no-cache add curl \
&& echo "Pulling watchdog binary from Github." \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.9/fwatchdog > /usr/bin/fwatchdog \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.12/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl --no-cache

Expand All @@ -26,7 +26,10 @@ RUN pip install -r requirements.txt

WORKDIR /home/app

RUN chown -R app ./
# chmod for tmp is for a buildkit issue (@alexellis)
RUN chown app:app -R /home/app \
&& chmod 777 /tmp

USER app

ENV fprocess="python3 index.py"
Expand Down
10 changes: 6 additions & 4 deletions template/ruby/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
FROM ruby:2.4-alpine3.6

RUN adduser app -D
RUN addgroup -S app && adduser -S -g app app

# Alternatively use ADD https:// (which will not be cached by Docker builder)
RUN apk --no-cache add curl \
&& echo "Pulling watchdog binary from Github." \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.9/fwatchdog > /usr/bin/fwatchdog \
&& curl -sSL https://github.com/openfaas/faas/releases/download/0.6.12/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl --no-cache

RUN mkdir -p /home/app/
WORKDIR /home/app/

COPY Gemfile .
Expand All @@ -22,7 +21,10 @@ RUN bundle install

WORKDIR /home/app/

RUN chown -R app ./
# chmod for tmp is for a buildkit issue (@alexellis)
RUN chown app:app -R /home/app \
&& chmod 777 /tmp

USER app

ENV fprocess="ruby index.rb"
Expand Down

0 comments on commit 345fd09

Please sign in to comment.