elastic-apm 3.5.0 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/Jenkinsfile +141 -121
- data/.ci/docker/jruby/11-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/12-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/13-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/7-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/8-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/README.md +31 -0
- data/.ci/docker/jruby/run.sh +73 -0
- data/.ci/docker/jruby/test.sh +13 -0
- data/.gitignore +3 -1
- data/.rubocop.yml +11 -2
- data/CHANGELOG.asciidoc +16 -0
- data/CONTRIBUTING.md +6 -4
- data/Gemfile +14 -9
- data/Rakefile +10 -5
- data/docker-compose.yml +5 -0
- data/docs/api.asciidoc +14 -2
- data/docs/configuration.asciidoc +5 -11
- data/docs/graphql.asciidoc +23 -0
- data/docs/index.asciidoc +4 -0
- data/docs/supported-technologies.asciidoc +51 -1
- data/docs/upgrading.asciidoc +45 -0
- data/lib/elastic_apm.rb +12 -0
- data/lib/elastic_apm/config.rb +7 -1
- data/lib/elastic_apm/graphql.rb +74 -0
- data/lib/elastic_apm/grpc.rb +82 -0
- data/lib/elastic_apm/resque.rb +12 -0
- data/lib/elastic_apm/span/context/destination.rb +20 -4
- data/lib/elastic_apm/spies/resque.rb +43 -0
- data/lib/elastic_apm/sql.rb +4 -4
- data/lib/elastic_apm/stacktrace_builder.rb +6 -1
- data/lib/elastic_apm/trace_context.rb +34 -11
- data/lib/elastic_apm/transport/serializers/span_serializer.rb +3 -1
- data/lib/elastic_apm/version.rb +1 -1
- metadata +16 -3
- data/CHANGELOG.md +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e226ecd39fc71213084dffaefbd4343c1d5f5d78a4d8fc91786dca9f5e865533
|
4
|
+
data.tar.gz: a0289b4872d55be4132b6982da072844ce71b2a6723877626584c1f5e8d7315f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 641923b3afdf3c3fe258053a2f2492092aa1af5a35a50c3783b6e7d0d00e6198f8454c95fb4f2eca0a1ea83f59afd552c600ffaed34efa0aeecf44d40b9948cd
|
7
|
+
data.tar.gz: 427eee529da777c98d4c4c02eb79f5aba46200e92edcac1f31b5bbd38df55f78801d92de063c37a54ffecf2fe3777697495c745f8334d3fdae4509626b1e1350
|
data/.ci/Jenkinsfile
CHANGED
@@ -104,158 +104,162 @@ pipeline {
|
|
104
104
|
testTasks[rubyVersion] = { runJob(rubyVersion, i++) }
|
105
105
|
}
|
106
106
|
parallel(testTasks)
|
107
|
-
}
|
108
107
|
}
|
109
108
|
}
|
110
109
|
}
|
111
110
|
}
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
111
|
+
}
|
112
|
+
stage('Integration Tests') {
|
113
|
+
agent none
|
114
|
+
when {
|
115
|
+
beforeAgent true
|
116
|
+
anyOf {
|
117
|
+
changeRequest()
|
118
|
+
expression { return !params.Run_As_Master_Branch }
|
119
|
+
}
|
120
|
+
}
|
121
|
+
steps {
|
122
|
+
build(job: env.ITS_PIPELINE, propagate: false, wait: false,
|
123
|
+
parameters: [string(name: 'INTEGRATION_TEST', value: 'Ruby'),
|
124
|
+
string(name: 'BUILD_OPTS', value: "--ruby-agent-version ${env.GIT_BASE_COMMIT} --ruby-agent-version-state ${env.GIT_BUILD_CAUSE} --ruby-agent-repo ${env.CHANGE_FORK?.trim() ?: 'elastic'}/${env.REPO} --opbeans-ruby-agent-branch ${env.GIT_BASE_COMMIT}"),
|
125
|
+
string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_ITS_NAME),
|
126
|
+
string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
|
127
|
+
string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT)])
|
128
|
+
githubNotify(context: "${env.GITHUB_CHECK_ITS_NAME}", description: "${env.GITHUB_CHECK_ITS_NAME} ...", status: 'PENDING', targetUrl: "${env.JENKINS_URL}search/?q=${env.ITS_PIPELINE.replaceAll('/','+')}")
|
129
|
+
}
|
130
|
+
}
|
131
|
+
stage('Benchmarks') {
|
132
|
+
options { skipDefaultCheckout() }
|
133
|
+
when {
|
134
|
+
beforeAgent true
|
135
|
+
allOf {
|
136
|
+
anyOf {
|
137
|
+
branch 'master'
|
138
|
+
branch "\\d+\\.\\d+"
|
139
|
+
branch "v\\d?"
|
140
|
+
tag "v\\d+\\.\\d+\\.\\d+*"
|
141
|
+
expression { return params.Run_As_Master_Branch }
|
125
142
|
}
|
143
|
+
expression { return params.bench_ci }
|
126
144
|
}
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
145
|
+
}
|
146
|
+
stages {
|
147
|
+
stage('Clean Workspace') {
|
148
|
+
agent { label 'metal' }
|
149
|
+
steps {
|
150
|
+
echo "Cleaning Workspace"
|
151
|
+
}
|
152
|
+
post {
|
153
|
+
always {
|
154
|
+
cleanWs()
|
137
155
|
}
|
138
156
|
}
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
parallel(benchmarkTask)
|
157
|
+
}
|
158
|
+
/**
|
159
|
+
Run the benchmarks and store the results on ES.
|
160
|
+
The result JSON files are also archive into Jenkins.
|
161
|
+
*/
|
162
|
+
stage('Run Benchmarks') {
|
163
|
+
steps {
|
164
|
+
withGithubNotify(context: 'Run Benchmarks') {
|
165
|
+
deleteDir()
|
166
|
+
unstash 'source'
|
167
|
+
dir("${BASE_DIR}"){
|
168
|
+
script {
|
169
|
+
def versions = readYaml(file: ".ci/.jenkins_ruby.yml")
|
170
|
+
def benchmarkTask = [:]
|
171
|
+
versions['RUBY_VERSION'].each{ v ->
|
172
|
+
benchmarkTask[v] = runBenchmark(v)
|
156
173
|
}
|
174
|
+
parallel(benchmarkTask)
|
157
175
|
}
|
158
176
|
}
|
159
177
|
}
|
160
178
|
}
|
161
179
|
}
|
162
180
|
}
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
}
|
167
|
-
steps {
|
168
|
-
script {
|
169
|
-
def message = 'Failures when running the "Test" stage'
|
170
|
-
if (notifyBuildResult.isAnyDownstreamJobFailedWithTimeout(rubyDownstreamJobs)) {
|
171
|
-
message += ' related to a timeout issue'
|
172
|
-
}
|
173
|
-
error(message)
|
174
|
-
}
|
175
|
-
}
|
181
|
+
}
|
182
|
+
stage('Populate Downstream failures') {
|
183
|
+
when {
|
184
|
+
expression { return rubyTasksFailed }
|
176
185
|
}
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
changeRequest()
|
183
|
-
expression { return !params.Run_As_Master_Branch }
|
186
|
+
steps {
|
187
|
+
script {
|
188
|
+
def message = 'Failures when running the "Test" stage'
|
189
|
+
if (notifyBuildResult.isAnyDownstreamJobFailedWithTimeout(rubyDownstreamJobs)) {
|
190
|
+
message += ' related to a timeout issue'
|
184
191
|
}
|
185
|
-
|
186
|
-
steps {
|
187
|
-
log(level: 'INFO', text: 'Launching Async ITs')
|
188
|
-
build(job: env.ITS_PIPELINE, propagate: false, wait: false,
|
189
|
-
parameters: [string(name: 'AGENT_INTEGRATION_TEST', value: 'Ruby'),
|
190
|
-
string(name: 'BUILD_OPTS', value: "--ruby-agent-version ${env.GIT_BASE_COMMIT} --ruby-agent-version-state ${env.GIT_BUILD_CAUSE} --ruby-agent-repo ${env.CHANGE_FORK?.trim() ?: 'elastic'}/${env.REPO}"),
|
191
|
-
string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_ITS_NAME),
|
192
|
-
string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
|
193
|
-
string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT)]
|
194
|
-
)
|
195
|
-
githubNotify(context: "${env.GITHUB_CHECK_ITS_NAME}", description: "${env.GITHUB_CHECK_ITS_NAME} ...", status: 'PENDING', targetUrl: "${env.JENKINS_URL}search/?q=${env.ITS_PIPELINE.replaceAll('/','+')}")
|
192
|
+
error(message)
|
196
193
|
}
|
197
194
|
}
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
195
|
+
}
|
196
|
+
stage('Release') {
|
197
|
+
options { skipDefaultCheckout() }
|
198
|
+
environment {
|
199
|
+
RUBY_DOCKER_TAG = 'ruby:2.6'
|
200
|
+
HOME = '/var/lib/jenkins'
|
201
|
+
}
|
202
|
+
when {
|
203
|
+
beforeAgent true
|
204
|
+
tag pattern: 'v\\d+.*', comparator: 'REGEXP'
|
205
|
+
}
|
206
|
+
stages {
|
207
|
+
stage('Release') {
|
208
|
+
steps {
|
209
|
+
deleteDir()
|
210
|
+
unstash 'source'
|
211
|
+
prepareRelease(){
|
212
|
+
sh 'rake release'
|
213
|
+
}
|
214
|
+
}
|
207
215
|
}
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
dir(BASE_DIR){
|
216
|
-
docker.image("${env.RUBY_DOCKER_TAG}").inside('-v ${REFERENCE_REPO}:${REFERENCE_REPO} -v /etc/passwd:/etc/passwd -v ${HOME}/.ssh:${HOME}/.ssh') {
|
217
|
-
withEnv(["HOME=${env.WORKSPACE}/${env.BASE_DIR ?: ''}"]) {
|
218
|
-
rubygemsLogin.withApi(secret: "${env.RELEASE_SECRET}") {
|
219
|
-
sshagent(['f6c7695a-671e-4f4f-a331-acdce44ff9ba']) {
|
220
|
-
sh '.ci/prepare-git-context.sh'
|
221
|
-
sh 'gem install rake yard rspec'
|
222
|
-
sh 'rake release'
|
223
|
-
}
|
224
|
-
}
|
225
|
-
}
|
226
|
-
}
|
227
|
-
}
|
228
|
-
}
|
216
|
+
stage('Update Branch') {
|
217
|
+
steps {
|
218
|
+
deleteDir()
|
219
|
+
unstash 'source'
|
220
|
+
prepareRelease(){
|
221
|
+
catchError(buildResult: 'SUCCESS', message: 'Update branch task failed', stageResult: 'UNSTABLE') {
|
222
|
+
sh 'rake release:update_branch'
|
229
223
|
}
|
230
224
|
}
|
231
225
|
}
|
232
|
-
|
233
|
-
|
234
|
-
|
226
|
+
post {
|
227
|
+
unsuccessful {
|
228
|
+
emailext subject: "[${env.REPO}] Syncup post-release stage failed.", to: "${NOTIFY_TO}",
|
229
|
+
body: "Please go to ${env.BUILD_URL} to review the logs. Most likely you need to update the branch manually."
|
235
230
|
}
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
231
|
+
}
|
232
|
+
}
|
233
|
+
stage('Opbeans') {
|
234
|
+
environment {
|
235
|
+
REPO_NAME = "${OPBEANS_REPO}"
|
236
|
+
VERSION = "${env.BRANCH_NAME.replaceAll('^v', '')}"
|
237
|
+
}
|
238
|
+
steps {
|
239
|
+
deleteDir()
|
240
|
+
// Let's wait for the Gem to be available
|
241
|
+
sh "(retry 10 curl --silent --show-error --fail -I https://rubygems.org/gems/elastic-apm/versions/${env.VERSION})"
|
242
|
+
dir("${OPBEANS_REPO}"){
|
243
|
+
git credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
|
244
|
+
url: "git@github.com:elastic/${OPBEANS_REPO}.git"
|
245
|
+
// It's required to transform the tag value to the gem version
|
246
|
+
sh script: ".ci/bump-version.sh ${env.VERSION}", label: 'Bump version'
|
247
|
+
// The opbeans pipeline will trigger a release for the master branch
|
248
|
+
gitPush()
|
249
|
+
// The opbeans pipeline will trigger a release for the release tag
|
250
|
+
gitCreateTag(tag: "${env.BRANCH_NAME}")
|
248
251
|
}
|
249
252
|
}
|
250
253
|
}
|
251
254
|
}
|
252
255
|
}
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
256
|
+
}
|
257
|
+
post {
|
258
|
+
cleanup {
|
259
|
+
notifyBuildResult(downstreamJobs: rubyDownstreamJobs)
|
257
260
|
}
|
258
261
|
}
|
262
|
+
}
|
259
263
|
|
260
264
|
/**
|
261
265
|
Run benchmarks for a Ruby version, then report the results to the Elasticsearch server.
|
@@ -314,3 +318,19 @@ def runJob(String rubyVersion, int sleep = 1){
|
|
314
318
|
rubyDownstreamJobs["${rubyVersion}"] = buildObject
|
315
319
|
}
|
316
320
|
}
|
321
|
+
|
322
|
+
def prepareRelease(Closure body){
|
323
|
+
dir("${env.BASE_DIR}"){
|
324
|
+
docker.image("${env.RUBY_DOCKER_TAG}").inside('-v ${REFERENCE_REPO}:${REFERENCE_REPO} -v /etc/passwd:/etc/passwd -v ${HOME}/.ssh:${HOME}/.ssh') {
|
325
|
+
withEnv(["HOME=${env.WORKSPACE}/${env.BASE_DIR ?: ''}"]) {
|
326
|
+
rubygemsLogin.withApi(secret: "${env.RELEASE_SECRET}") {
|
327
|
+
sshagent(['f6c7695a-671e-4f4f-a331-acdce44ff9ba']) {
|
328
|
+
sh '.ci/prepare-git-context.sh'
|
329
|
+
sh 'gem install rake yard rspec'
|
330
|
+
body()
|
331
|
+
}
|
332
|
+
}
|
333
|
+
}
|
334
|
+
}
|
335
|
+
}
|
336
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
FROM openjdk:11-jdk
|
2
|
+
|
3
|
+
RUN apt-get update \
|
4
|
+
&& apt-get install -y libc6-dev --no-install-recommends \
|
5
|
+
&& rm -rf /var/lib/apt/lists/*
|
6
|
+
|
7
|
+
ENV JRUBY_VERSION 9.2.10.0
|
8
|
+
ENV JRUBY_SHA256 9199707712c683c525252ccb1de5cb8e75f53b790c5b57a18f6367039ec79553
|
9
|
+
|
10
|
+
RUN mkdir -p /opt/jruby \
|
11
|
+
&& curl -fSL https://repo1.maven.org/maven2/org/jruby/jruby-dist/${JRUBY_VERSION}/jruby-dist-${JRUBY_VERSION}-bin.tar.gz -o /tmp/jruby.tar.gz \
|
12
|
+
&& echo "$JRUBY_SHA256 */tmp/jruby.tar.gz" | sha256sum -c - \
|
13
|
+
&& tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
|
14
|
+
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1
|
15
|
+
|
16
|
+
# set the jruby binaries in the path
|
17
|
+
ENV PATH /opt/jruby/bin:$PATH
|
18
|
+
|
19
|
+
# skip installing gem documentation
|
20
|
+
RUN mkdir -p /opt/jruby/etc \
|
21
|
+
&& { \
|
22
|
+
echo 'install: --no-document'; \
|
23
|
+
echo 'update: --no-document'; \
|
24
|
+
} >> /opt/jruby/etc/gemrc
|
25
|
+
|
26
|
+
# install bundler, gem requires bash to work
|
27
|
+
RUN gem install bundler rake net-telnet xmlrpc tzinfo-data
|
28
|
+
|
29
|
+
# install things globally, for great justice
|
30
|
+
# and don't create ".bundle" in all our apps
|
31
|
+
ENV GEM_HOME /usr/local/bundle
|
32
|
+
ENV BUNDLE_PATH="$GEM_HOME" \
|
33
|
+
BUNDLE_BIN="$GEM_HOME/bin" \
|
34
|
+
BUNDLE_SILENCE_ROOT_WARNING=1 \
|
35
|
+
BUNDLE_APP_CONFIG="$GEM_HOME"
|
36
|
+
ENV PATH $BUNDLE_BIN:$PATH
|
37
|
+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
|
38
|
+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
|
39
|
+
|
40
|
+
CMD [ "irb" ]
|
@@ -0,0 +1,40 @@
|
|
1
|
+
FROM adoptopenjdk:12-jdk-openj9
|
2
|
+
|
3
|
+
RUN apt-get update \
|
4
|
+
&& apt-get install -y libc6-dev git tcc netbase --no-install-recommends \
|
5
|
+
&& rm -rf /var/lib/apt/lists/*
|
6
|
+
|
7
|
+
ENV JRUBY_VERSION 9.2.10.0
|
8
|
+
ENV JRUBY_SHA256 9199707712c683c525252ccb1de5cb8e75f53b790c5b57a18f6367039ec79553
|
9
|
+
|
10
|
+
RUN mkdir -p /opt/jruby \
|
11
|
+
&& curl -fSL https://repo1.maven.org/maven2/org/jruby/jruby-dist/${JRUBY_VERSION}/jruby-dist-${JRUBY_VERSION}-bin.tar.gz -o /tmp/jruby.tar.gz \
|
12
|
+
&& echo "$JRUBY_SHA256 */tmp/jruby.tar.gz" | sha256sum -c - \
|
13
|
+
&& tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
|
14
|
+
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1
|
15
|
+
|
16
|
+
# set the jruby binaries in the path
|
17
|
+
ENV PATH /opt/jruby/bin:$PATH
|
18
|
+
|
19
|
+
# skip installing gem documentation
|
20
|
+
RUN mkdir -p /opt/jruby/etc \
|
21
|
+
&& { \
|
22
|
+
echo 'install: --no-document'; \
|
23
|
+
echo 'update: --no-document'; \
|
24
|
+
} >> /opt/jruby/etc/gemrc
|
25
|
+
|
26
|
+
# install bundler, gem requires bash to work
|
27
|
+
RUN gem install bundler rake net-telnet xmlrpc tzinfo-data
|
28
|
+
|
29
|
+
# install things globally, for great justice
|
30
|
+
# and don't create ".bundle" in all our apps
|
31
|
+
ENV GEM_HOME /usr/local/bundle
|
32
|
+
ENV BUNDLE_PATH="$GEM_HOME" \
|
33
|
+
BUNDLE_BIN="$GEM_HOME/bin" \
|
34
|
+
BUNDLE_SILENCE_ROOT_WARNING=1 \
|
35
|
+
BUNDLE_APP_CONFIG="$GEM_HOME"
|
36
|
+
ENV PATH $BUNDLE_BIN:$PATH
|
37
|
+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
|
38
|
+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
|
39
|
+
|
40
|
+
CMD [ "irb" ]
|
@@ -0,0 +1,40 @@
|
|
1
|
+
FROM openjdk:13-jdk-slim
|
2
|
+
|
3
|
+
RUN apt-get update \
|
4
|
+
&& apt-get install -y libc6-dev git tcc curl netbase --no-install-recommends \
|
5
|
+
&& rm -rf /var/lib/apt/lists/*
|
6
|
+
|
7
|
+
ENV JRUBY_VERSION 9.2.10.0
|
8
|
+
ENV JRUBY_SHA256 9199707712c683c525252ccb1de5cb8e75f53b790c5b57a18f6367039ec79553
|
9
|
+
|
10
|
+
RUN mkdir -p /opt/jruby \
|
11
|
+
&& curl -fSL https://repo1.maven.org/maven2/org/jruby/jruby-dist/${JRUBY_VERSION}/jruby-dist-${JRUBY_VERSION}-bin.tar.gz -o /tmp/jruby.tar.gz \
|
12
|
+
&& echo "$JRUBY_SHA256 */tmp/jruby.tar.gz" | sha256sum -c - \
|
13
|
+
&& tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
|
14
|
+
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1
|
15
|
+
|
16
|
+
# set the jruby binaries in the path
|
17
|
+
ENV PATH /opt/jruby/bin:$PATH
|
18
|
+
|
19
|
+
# skip installing gem documentation
|
20
|
+
RUN mkdir -p /opt/jruby/etc \
|
21
|
+
&& { \
|
22
|
+
echo 'install: --no-document'; \
|
23
|
+
echo 'update: --no-document'; \
|
24
|
+
} >> /opt/jruby/etc/gemrc
|
25
|
+
|
26
|
+
# install bundler, gem requires bash to work
|
27
|
+
RUN gem install bundler rake net-telnet xmlrpc tzinfo-data
|
28
|
+
|
29
|
+
# install things globally, for great justice
|
30
|
+
# and don't create ".bundle" in all our apps
|
31
|
+
ENV GEM_HOME /usr/local/bundle
|
32
|
+
ENV BUNDLE_PATH="$GEM_HOME" \
|
33
|
+
BUNDLE_BIN="$GEM_HOME/bin" \
|
34
|
+
BUNDLE_SILENCE_ROOT_WARNING=1 \
|
35
|
+
BUNDLE_APP_CONFIG="$GEM_HOME"
|
36
|
+
ENV PATH $BUNDLE_BIN:$PATH
|
37
|
+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
|
38
|
+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
|
39
|
+
|
40
|
+
CMD [ "irb" ]
|
@@ -0,0 +1,40 @@
|
|
1
|
+
FROM openjdk:7-jdk
|
2
|
+
|
3
|
+
RUN apt-get update \
|
4
|
+
&& apt-get install -y libc6-dev --no-install-recommends \
|
5
|
+
&& rm -rf /var/lib/apt/lists/*
|
6
|
+
|
7
|
+
ENV JRUBY_VERSION 9.1.17.0
|
8
|
+
ENV JRUBY_SHA256 6a22f7bf8fef1a52530a9c9781a9d374ad07bbbef0d3d8e2af0ff5cbead0dfd5
|
9
|
+
|
10
|
+
RUN mkdir -p /opt/jruby \
|
11
|
+
&& curl -fSL https://repo1.maven.org/maven2/org/jruby/jruby-dist/${JRUBY_VERSION}/jruby-dist-${JRUBY_VERSION}-bin.tar.gz -o /tmp/jruby.tar.gz \
|
12
|
+
&& echo "$JRUBY_SHA256 */tmp/jruby.tar.gz" | sha256sum -c - \
|
13
|
+
&& tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
|
14
|
+
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1
|
15
|
+
|
16
|
+
# set the jruby binaries in the path
|
17
|
+
ENV PATH /opt/jruby/bin:$PATH
|
18
|
+
|
19
|
+
# skip installing gem documentation
|
20
|
+
RUN mkdir -p /opt/jruby/etc \
|
21
|
+
&& { \
|
22
|
+
echo 'install: --no-document'; \
|
23
|
+
echo 'update: --no-document'; \
|
24
|
+
} >> /opt/jruby/etc/gemrc
|
25
|
+
|
26
|
+
# install bundler, gem requires bash to work
|
27
|
+
RUN gem install bundler rake net-telnet xmlrpc tzinfo-data
|
28
|
+
|
29
|
+
# install things globally, for great justice
|
30
|
+
# and don't create ".bundle" in all our apps
|
31
|
+
ENV GEM_HOME /usr/local/bundle
|
32
|
+
ENV BUNDLE_PATH="$GEM_HOME" \
|
33
|
+
BUNDLE_BIN="$GEM_HOME/bin" \
|
34
|
+
BUNDLE_SILENCE_ROOT_WARNING=1 \
|
35
|
+
BUNDLE_APP_CONFIG="$GEM_HOME"
|
36
|
+
ENV PATH $BUNDLE_BIN:$PATH
|
37
|
+
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
|
38
|
+
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
|
39
|
+
|
40
|
+
CMD [ "irb" ]
|