Skip to content

Commit

Permalink
!40 非root用户启动容器镜像
Browse files Browse the repository at this point in the history
Merge pull request !40 from wu/master
  • Loading branch information
JoannaNil authored and gitee-org committed Jul 15, 2024
2 parents a38c747 + 18be91f commit 6dd9408
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM openjdk:8-jdk
RUN mkdir -p /var/lib/om-kafka

WORKDIR /var/lib/om-kafka
COPY . /var/lib/om-kafka

# Install basic software support
RUN apt-get update && \
Expand All @@ -15,11 +16,10 @@ ENV MAVEN_HOEM=/var/lib/om-kafka/apache-maven-3.8.8

ENV PATH=$MAVEN_HOEM/bin:$PATH

MAINTAINER zhongjun <[email protected]>
RUN mvn clean install assembly:single -Dmaven.test.skip && \
mv ./target/omkafka-1.0-SNAPSHOT.jar ./om-kafka.jar

RUN git clone https://gitee.com/opensourceway/om-kafka.git && \
cd om-kafka && \
mvn clean install assembly:single -Dmaven.test.skip && \
mv ./target/omkafka-1.0-SNAPSHOT.jar ../om-kafka.jar
RUN useradd -u 1000 omkafka -s /bin/bash -m -U

USER omkafka
CMD java -jar om-kafka.jar

0 comments on commit 6dd9408

Please sign in to comment.