-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update redmine entrypoint #3194
Merged
yosifkit
merged 1 commit into
docker-library:master
from
infosiftr:update-docker-library
Jul 13, 2017
Merged
Update redmine entrypoint #3194
yosifkit
merged 1 commit into
docker-library:master
from
infosiftr:update-docker-library
Jul 13, 2017
Conversation
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
Diff:diff --git a/redmine_3.1/Dockerfile b/redmine_3.1/Dockerfile
index 0895b38..68f445b 100644
--- a/redmine_3.1/Dockerfile
+++ b/redmine_3.1/Dockerfile
@@ -76,6 +76,7 @@ RUN buildDeps=' \
echo "$RAILS_ENV:" > ./config/database.yml; \
echo " adapter: $adapter" >> ./config/database.yml; \
bundle install --without development test; \
+ cp Gemfile.lock "Gemfile.lock.${adapter}"; \
done \
&& rm ./config/database.yml \
&& apt-get purge -y --auto-remove $buildDeps
diff --git a/redmine_3.1/docker-entrypoint.sh b/redmine_3.1/docker-entrypoint.sh
index 6c70881..664a40c 100755
--- a/redmine_3.1/docker-entrypoint.sh
+++ b/redmine_3.1/docker-entrypoint.sh
@@ -87,10 +87,20 @@ case "$1" in
[ -n "$val" ] || continue
echo " $var: \"$val\"" >> config/database.yml
done
+ else
+ # parse the database config to get the database adapter name
+ # so we can use the right Gemfile.lock
+ adapter="$(
+ bundle exec ruby -e "
+ require 'yaml'
+ conf = YAML.load_file('./config/database.yml')
+ puts conf['$RAILS_ENV']['adapter']
+ "
+ )"
fi
# ensure the right database adapter is active in the Gemfile.lock
- bundle install --without development test
+ cp "Gemfile.lock.${adapter}" Gemfile.lock
if [ ! -s config/secrets.yml ]; then
file_env 'REDMINE_SECRET_KEY_BASE'
diff --git a/redmine_3.2/Dockerfile b/redmine_3.2/Dockerfile
index aa3a234..e581325 100644
--- a/redmine_3.2/Dockerfile
+++ b/redmine_3.2/Dockerfile
@@ -76,6 +76,7 @@ RUN buildDeps=' \
echo "$RAILS_ENV:" > ./config/database.yml; \
echo " adapter: $adapter" >> ./config/database.yml; \
bundle install --without development test; \
+ cp Gemfile.lock "Gemfile.lock.${adapter}"; \
done \
&& rm ./config/database.yml \
&& apt-get purge -y --auto-remove $buildDeps
diff --git a/redmine_3.2/docker-entrypoint.sh b/redmine_3.2/docker-entrypoint.sh
index 6c70881..664a40c 100755
--- a/redmine_3.2/docker-entrypoint.sh
+++ b/redmine_3.2/docker-entrypoint.sh
@@ -87,10 +87,20 @@ case "$1" in
[ -n "$val" ] || continue
echo " $var: \"$val\"" >> config/database.yml
done
+ else
+ # parse the database config to get the database adapter name
+ # so we can use the right Gemfile.lock
+ adapter="$(
+ bundle exec ruby -e "
+ require 'yaml'
+ conf = YAML.load_file('./config/database.yml')
+ puts conf['$RAILS_ENV']['adapter']
+ "
+ )"
fi
# ensure the right database adapter is active in the Gemfile.lock
- bundle install --without development test
+ cp "Gemfile.lock.${adapter}" Gemfile.lock
if [ ! -s config/secrets.yml ]; then
file_env 'REDMINE_SECRET_KEY_BASE'
diff --git a/redmine_3.3/Dockerfile b/redmine_3.3/Dockerfile
index e753b99..74edf9f 100644
--- a/redmine_3.3/Dockerfile
+++ b/redmine_3.3/Dockerfile
@@ -76,6 +76,7 @@ RUN buildDeps=' \
echo "$RAILS_ENV:" > ./config/database.yml; \
echo " adapter: $adapter" >> ./config/database.yml; \
bundle install --without development test; \
+ cp Gemfile.lock "Gemfile.lock.${adapter}"; \
done \
&& rm ./config/database.yml \
&& apt-get purge -y --auto-remove $buildDeps
diff --git a/redmine_3.3/docker-entrypoint.sh b/redmine_3.3/docker-entrypoint.sh
index 6c70881..664a40c 100755
--- a/redmine_3.3/docker-entrypoint.sh
+++ b/redmine_3.3/docker-entrypoint.sh
@@ -87,10 +87,20 @@ case "$1" in
[ -n "$val" ] || continue
echo " $var: \"$val\"" >> config/database.yml
done
+ else
+ # parse the database config to get the database adapter name
+ # so we can use the right Gemfile.lock
+ adapter="$(
+ bundle exec ruby -e "
+ require 'yaml'
+ conf = YAML.load_file('./config/database.yml')
+ puts conf['$RAILS_ENV']['adapter']
+ "
+ )"
fi
# ensure the right database adapter is active in the Gemfile.lock
- bundle install --without development test
+ cp "Gemfile.lock.${adapter}" Gemfile.lock
if [ ! -s config/secrets.yml ]; then
file_env 'REDMINE_SECRET_KEY_BASE'
diff --git a/redmine_latest/Dockerfile b/redmine_latest/Dockerfile
index 23ad7ee..a448b82 100644
--- a/redmine_latest/Dockerfile
+++ b/redmine_latest/Dockerfile
@@ -76,6 +76,7 @@ RUN buildDeps=' \
echo "$RAILS_ENV:" > ./config/database.yml; \
echo " adapter: $adapter" >> ./config/database.yml; \
bundle install --without development test; \
+ cp Gemfile.lock "Gemfile.lock.${adapter}"; \
done \
&& rm ./config/database.yml \
&& apt-get purge -y --auto-remove $buildDeps
diff --git a/redmine_latest/docker-entrypoint.sh b/redmine_latest/docker-entrypoint.sh
index 6c70881..664a40c 100755
--- a/redmine_latest/docker-entrypoint.sh
+++ b/redmine_latest/docker-entrypoint.sh
@@ -87,10 +87,20 @@ case "$1" in
[ -n "$val" ] || continue
echo " $var: \"$val\"" >> config/database.yml
done
+ else
+ # parse the database config to get the database adapter name
+ # so we can use the right Gemfile.lock
+ adapter="$(
+ bundle exec ruby -e "
+ require 'yaml'
+ conf = YAML.load_file('./config/database.yml')
+ puts conf['$RAILS_ENV']['adapter']
+ "
+ )"
fi
# ensure the right database adapter is active in the Gemfile.lock
- bundle install --without development test
+ cp "Gemfile.lock.${adapter}" Gemfile.lock
if [ ! -s config/secrets.yml ]; then
file_env 'REDMINE_SECRET_KEY_BASE' |
tianon
approved these changes
Jul 13, 2017
Build test of #3194; f08a0bd ( $ bashbrew build redmine:3.4.1
Building bashbrew/cache:979ddd63c23a0107edcb363e45a75efdd95e42b66799a2204da69c570ae28896 (redmine:3.4.1)
Tagging redmine:3.4.1
Tagging redmine:3.4
Tagging redmine:3
Tagging redmine:latest
$ test/run.sh redmine:3.4.1
testing redmine:3.4.1
'utc' [1/5]...passed
'cve-2014--shellshock' [2/5]...passed
'no-hard-coded-passwords' [3/5]...passed
'override-cmd' [4/5]...passed
'redmine-basics' [5/5]..........passed
$ bashbrew build redmine:3.4.1-passenger
Building bashbrew/cache:f6ca0db495f413482577660c14e1eacf602b318d4cfe70b8546f0eb614df8692 (redmine:3.4.1-passenger)
Tagging redmine:3.4.1-passenger
Tagging redmine:3.4-passenger
Tagging redmine:3-passenger
Tagging redmine:passenger
$ test/run.sh redmine:3.4.1-passenger
testing redmine:3.4.1-passenger
'utc' [1/5]...passed
'cve-2014--shellshock' [2/5]...passed
'no-hard-coded-passwords' [3/5]...passed
'override-cmd' [4/5]...passed
'redmine-basics' [5/5]........passed
$ bashbrew build redmine:3.3.4
Building bashbrew/cache:186641bcce103a2b56fe1f41be313d749dedfb884f946f85e75bd7201c5aa030 (redmine:3.3.4)
Tagging redmine:3.3.4
Tagging redmine:3.3
$ test/run.sh redmine:3.3.4
testing redmine:3.3.4
'utc' [1/5]...passed
'cve-2014--shellshock' [2/5]...passed
'no-hard-coded-passwords' [3/5]...passed
'override-cmd' [4/5]...passed
'redmine-basics' [5/5].........passed
$ bashbrew build redmine:3.3.4-passenger
Building bashbrew/cache:2c6ba6aa8d7466929b245caca07324a12cb75402ac641619aff173a4eabe8cbc (redmine:3.3.4-passenger)
Tagging redmine:3.3.4-passenger
Tagging redmine:3.3-passenger
$ test/run.sh redmine:3.3.4-passenger
testing redmine:3.3.4-passenger
'utc' [1/5]...passed
'cve-2014--shellshock' [2/5]...passed
'no-hard-coded-passwords' [3/5]...passed
'override-cmd' [4/5]...passed
'redmine-basics' [5/5].........passed
$ bashbrew build redmine:3.2.7
Building bashbrew/cache:105cfc1de90b55e6810c512713fbdf7d0cd6486544d4639255d33a984bbdd5c9 (redmine:3.2.7)
Tagging redmine:3.2.7
Tagging redmine:3.2
$ test/run.sh redmine:3.2.7
testing redmine:3.2.7
'utc' [1/5]...passed
'cve-2014--shellshock' [2/5]...passed
'no-hard-coded-passwords' [3/5]...passed
'override-cmd' [4/5]...passed
'redmine-basics' [5/5]..........passed
$ bashbrew build redmine:3.2.7-passenger
Building bashbrew/cache:b1fead28516ac32250acac8e20ff827eefd81a5021d09f15135b9db8f5681119 (redmine:3.2.7-passenger)
Tagging redmine:3.2.7-passenger
Tagging redmine:3.2-passenger
$ test/run.sh redmine:3.2.7-passenger
testing redmine:3.2.7-passenger
'utc' [1/5]...passed
'cve-2014--shellshock' [2/5]...passed
'no-hard-coded-passwords' [3/5]...passed
'override-cmd' [4/5]...passed
'redmine-basics' [5/5]........passed
$ bashbrew build redmine:3.1.7
Building bashbrew/cache:da9d9b8c58adc6687978bcca53690da05537c77bafc9160674872942ef2a37b6 (redmine:3.1.7)
Tagging redmine:3.1.7
Tagging redmine:3.1
$ test/run.sh redmine:3.1.7
testing redmine:3.1.7
'utc' [1/5]...passed
'cve-2014--shellshock' [2/5]...passed
'no-hard-coded-passwords' [3/5]...passed
'override-cmd' [4/5]...passed
'redmine-basics' [5/5]..........passed
$ bashbrew build redmine:3.1.7-passenger
Building bashbrew/cache:cca188c4ec989a0d7d698e9f01b191cf34783b88be9303baf68e431607ef74f3 (redmine:3.1.7-passenger)
Tagging redmine:3.1.7-passenger
Tagging redmine:3.1-passenger
$ test/run.sh redmine:3.1.7-passenger
testing redmine:3.1.7-passenger
'utc' [1/5]...passed
'cve-2014--shellshock' [2/5]...passed
'no-hard-coded-passwords' [3/5]...passed
'override-cmd' [4/5]...passed
'redmine-basics' [5/5].........passed
|
This was referenced Jul 14, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See docker-library/redmine#80.
This should also fix the
mysql2
gem issues in docker-library/redmine#78; since it won't be trying to install gems on run.