方式1:直接使用镜像启动
1. 获取镜像
# 查看可用的稳定版本
docker search azkaban
# 版本:azkaban-3.32.1;镜像大小:1.55GB;URL:https://hub.docker.com/r/inovvo/azkaban-standalone
docker pull inovvo/azkaban-standalone
docker image ls |grep azkaban
2. 启动容器
# -i:以交互模式运行容器;-t:为容器重新分配一个伪输入终端;-d:后台运行容器,并返回容器ID;
docker run -itd --name azkaban_docker -p 8081:8081 inovvo/azkaban-standalone
docker ps |grep azkaban_docker
docker start azkaban_docker
docker restart azkaban_docker
docker stop azkaban_docker
docker rm azkaban_docker
方式2:Dockerfile构建启动
1. 编写Dockerfile
vi azkaban.Dockerfile
内容如下:
FROM inovvo/azkaban-base:3.32.1
WORKDIR /app/azkaban/azkaban-solo-server/build/install/azkaban-solo-server
RUN chmod +x bin/*.sh
EXPOSE 8443 8081 5005
CMD bin/azkaban-solo-start.sh && tail --pid=`cat currentpid` -f /dev/null
补充(基础镜像:azkaban-base:3.32.1的Dockerfile构建文件):
FROM java:8
RUN apt-get update -yqq \
&& apt-get install -yqq \
git
WORKDIR /app/
RUN git clone https://github.com/azkaban/azkaban.git
WORKDIR /app/azkaban
RUN git checkout 3.32.1
RUN bash gradlew build installDist -x test
2. 构建镜像
docker build -f azkaban.Dockerfile -t azkaban-solo:v3.32.1 .
docker images | grep azkaban-solo
3. 启动容器
docker run -itd --name azkaban_docker -p 8081:8081 azkaban-solo:v3.32.1
docker ps |grep azkaban_docker
docker start azkaban_docker
docker restart azkaban_docker
docker stop azkaban_docker
docker rm azkaban_docker
验证
Web UI:http://192.168.216.100:8081
账户口令:azkaban/azkaban**