forked from hawx/guard-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (44 loc) · 1.71 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#-------------------------------------------------------------------------------
# Image
FROM ruby:3.0.1-alpine
#-------------------------------------------------------------------------------
# Packages
RUN set -exo pipefail && \
\
echo 'Install system packages' && \
apk add --update --no-cache \
build-base \
less
#-------------------------------------------------------------------------------
# Workspace
RUN set -exo pipefail && \
\
echo 'Create workspace' && \
mkdir -p /work
WORKDIR /work
#-------------------------------------------------------------------------------
# User
ARG HOST_USER_UID=1000
ARG HOST_USER_GID=1000
RUN set -exo pipefail && \
\
echo 'Create the git user and group from host' && \
addgroup -g $HOST_USER_GID -S notroot && \
adduser -u $HOST_USER_UID -G notroot -D notroot && \
\
echo 'Set direcotry permissions' && \
chown notroot:notroot /work
#-------------------------------------------------------------------------------
# Gems
COPY --chown=notroot:notroot Gemfile* guard-shell.gemspec /work/
USER notroot
RUN set -exo pipefail && \
\
echo 'Install gems' && \
cd /work && \
bundle config --global jobs 3 && \
bundle config --global retry 3 && \
bundle install
#-------------------------------------------------------------------------------
# Command
CMD ["sh"]