1
- FROM registry.opensuse.org/opensuse/leap:15.4
1
+ FROM registry.opensuse.org/opensuse/infrastructure/dale/containers/hackweek/base:latest
2
2
ARG CONTAINER_USERID=1000
3
3
4
- # Add needed repos
5
- RUN echo 'solver.allowVendorChange = true' >> /etc/zypp/zypp.conf; \
6
- zypper ar -f https://download.opensuse.org/repositories/openSUSE:/infrastructure:/dale/15.4/openSUSE:infrastructure:dale.repo; \
7
- zypper ar -f https://download.opensuse.org/repositories/devel:/languages:/ruby/15.4/devel:languages:ruby.repo; \
8
- zypper --gpg-auto-import-keys refresh
9
-
10
- # Install requirements
11
- RUN zypper -n install --no-recommends --replacefiles \
12
- curl vim vim-data psmisc timezone ack glibc-locale sudo hostname \
13
- sphinx libxml2-devel libxslt-devel libffi-devel sqlite3-devel nodejs8 gcc-c++ \
14
- ImageMagick libmariadb-devel ruby3.1-devel make git-core mariadb-client \
15
- chromium xorg-x11-fonts; \
16
- zypper -n clean --all
17
-
18
- # Add our user
19
- RUN useradd -m hackweek
20
-
21
4
# Configure our user
22
5
RUN usermod -u $CONTAINER_USERID hackweek
23
6
24
- # Setup sudo
25
- RUN echo 'hackweek ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
26
-
27
- # Disable versioned gem binary names
28
- RUN echo 'install: --no-format-executable' >> /etc/gemrc
29
-
30
7
# We copy the Gemfiles into this intermediate build stage so it's checksum
31
8
# changes and all the subsequent stages (a.k.a. the bundle install call below)
32
9
# have to be rebuild. Otherwise, after the first build of this image,
@@ -35,32 +12,12 @@ ADD Gemfile /hackweek/Gemfile
35
12
ADD Gemfile.lock /hackweek/Gemfile.lock
36
13
RUN chown -R hackweek /hackweek
37
14
38
- # Install bundler
39
- RUN gem.ruby3.1 install bundler -v "$(grep -A 1 " BUNDLED WITH" /hackweek/Gemfile.lock | tail -n 1)" ; \
40
- gem.ruby3.1 install foreman
41
-
42
- # Setup Ruby 3.1 as default
43
- RUN ln -sf /usr/bin/ruby.ruby3.1 /home/hackweek/bin/ruby; \
44
- ln -sf /usr/bin/gem.ruby3.1 /home/hackweek/bin/gem; \
45
- ln -sf /usr/bin/bundle.ruby3.1 /home/hackweek/bin/bundle; \
46
- ln -sf /usr/bin/rake.ruby3.1 /home/hackweek/bin/rake;
47
- ENV PATH /home/hackweek/bin:$PATH
48
-
49
15
WORKDIR /hackweek
50
16
USER hackweek
51
17
52
- # Setup shell history
53
- ADD --chown=hackweek:users .irbrc /home/hackweek/.irbrc
54
- RUN ln -sf /hackweek/tmp/.bash_history /home/hackweek/.bash_history; \
55
- ln -sf /hackweek/tmp/.irb_history /home/hackweek/.irb_history;
56
-
57
- # Configure our bundle
58
- RUN bundle config build.ffi --enable-system-libffi; \
59
- bundle config build.nokogiri --use-system-libraries; \
60
- bundle config build.sassc --disable-march-tune-native;
61
-
62
- # Install our bundle
63
- RUN bundle install --jobs=3 --retry=3
18
+ # Install our bundle & process manager
19
+ RUN bundle install --jobs=3 --retry=3; \
20
+ gem install foreman
64
21
65
22
# Run our command
66
23
CMD ["foreman" , "start" , "-f" , "Procfile" ]
0 commit comments