Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
jeckste committed May 2, 2016
0 parents commit 5d13552
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM centos:7
RUN yum update -y && yum -y install java-1.8.0-openjdk-devel openssh-clients && yum clean all
RUN groupadd -r karaf -g 1000 && useradd -u 1000 -r -g karaf -m -d /opt/karaf -s /sbin/nologin -c "Karaf user" karaf && \
chmod 755 /opt/karaf
WORKDIR /opt/karaf
ADD shell /opt/karaf
RUN chmod a+x /opt/karaf/shell && ln -s /opt/karaf/shell /usr/bin/shell

ENV JAVA_HOME /usr/lib/jvm/java
ENV KARAF_HOME /opt/karaf/latest
ADD apache-karaf-4.0.5.tar.gz /opt/karaf
RUN ln -s /opt/karaf/apache-karaf-4.0.5 /opt/karaf/latest
ADD config/* /opt/karaf/latest/etc
RUN chown -R karaf /opt/karaf
USER karaf
EXPOSE 8181 1099 8101 5005
CMD latest/bin/karaf clean server

Binary file added apache-karaf-4.0.5.tar.gz
Binary file not shown.
60 changes: 60 additions & 0 deletions config/org.ops4j.pax.logging.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
################################################################################
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

# Root logger
log4j.rootLogger=INFO, stdout, osgi:*
log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer

# Security audit logger
log4j.logger.org.apache.karaf.jaas.modules.audit=INFO, audit
log4j.additivity.org.apache.karaf.jaas.modules.audit=false

# CONSOLE appender not used by default
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n

# File appender
log4j.appender.out=org.apache.log4j.RollingFileAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
log4j.appender.out.file=${karaf.data}/log/karaf.log
log4j.appender.out.append=true
log4j.appender.out.maxFileSize=1MB
log4j.appender.out.maxBackupIndex=10

# Audit appender
log4j.appender.audit=org.apache.log4j.RollingFileAppender
log4j.appender.audit.layout=org.apache.log4j.PatternLayout
log4j.appender.audit.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
log4j.appender.audit.file=${karaf.data}/security/audit.log
log4j.appender.audit.append=true
log4j.appender.audit.maxFileSize=1MB
log4j.appender.audit.maxBackupIndex=10

# Sift appender
log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender
log4j.appender.sift.key=bundle.name
log4j.appender.sift.default=karaf
log4j.appender.sift.appender=org.apache.log4j.FileAppender
log4j.appender.sift.appender.layout=org.apache.log4j.PatternLayout
log4j.appender.sift.appender.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %m%n
log4j.appender.sift.appender.file=${karaf.data}/log/$\\{bundle.name\\}.log
log4j.appender.sift.appender.append=true

4 changes: 4 additions & 0 deletions shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
echo "Starting Karaf shell";
sed -i 's/log4j\.rootLogger=INFO, stdout/log4j\.rootLogger=INFO, out/g' latest/etc/org.ops4j.pax.logging.cfg
latest/bin/karaf clean

0 comments on commit 5d13552

Please sign in to comment.