-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize docker image as suggested in #97
- Loading branch information
Showing
3 changed files
with
18 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,22 @@ | |
# docker build -t transmission-rss --build-arg UID=1337 --build-arg GID=1337 . | ||
# docker run -it -v $(pwd)/transmission-rss.conf:/etc/transmission-rss.conf transmission-rss | ||
|
||
FROM ruby:alpine | ||
MAINTAINER henning mueller <[email protected]> | ||
FROM alpine:3 as builder | ||
RUN apk add gcc libc-dev make ruby-dev | ||
COPY . /tmp | ||
WORKDIR /tmp | ||
RUN \ | ||
gem build transmission-rss.gemspec && \ | ||
gem install -N --build-root /build transmission-rss-*.gem | ||
|
||
FROM alpine:3 | ||
MAINTAINER henning mueller <[email protected]> | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
||
RUN \ | ||
addgroup -g $GID ruby && \ | ||
adduser -u $UID -G ruby -D ruby && \ | ||
apk --no-cache --update add build-base libffi-dev | ||
|
||
WORKDIR home/ruby | ||
COPY . transmission-rss | ||
RUN chown -R ruby:ruby transmission-rss | ||
|
||
apk add --no-cache ruby ruby-etc ruby-json | ||
USER ruby | ||
|
||
WORKDIR transmission-rss | ||
RUN bundle | ||
|
||
CMD bundle exec ./bin/transmission-rss | ||
COPY --from=builder /build / | ||
CMD ["transmission-rss"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters