方式1:直接使用镜像启动

1. 获取镜像

  1. # 查看可用的稳定版本
  2. docker search azkaban
  3. # 版本:azkaban-3.32.1;镜像大小:1.55GB;URL:https://hub.docker.com/r/inovvo/azkaban-standalone
  4. docker pull inovvo/azkaban-standalone
  5. docker image ls |grep azkaban

2. 启动容器

  1. # -i:以交互模式运行容器;-t:为容器重新分配一个伪输入终端;-d:后台运行容器,并返回容器ID;
  2. docker run -itd --name azkaban_docker -p 8081:8081 inovvo/azkaban-standalone
  3. docker ps |grep azkaban_docker
  4. docker start azkaban_docker
  5. docker restart azkaban_docker
  6. docker stop azkaban_docker
  7. docker rm azkaban_docker

方式2:Dockerfile构建启动

1. 编写Dockerfile

  1. vi azkaban.Dockerfile

内容如下:

  1. FROM inovvo/azkaban-base:3.32.1
  2. WORKDIR /app/azkaban/azkaban-solo-server/build/install/azkaban-solo-server
  3. RUN chmod +x bin/*.sh
  4. EXPOSE 8443 8081 5005
  5. CMD bin/azkaban-solo-start.sh && tail --pid=`cat currentpid` -f /dev/null

补充(基础镜像:azkaban-base:3.32.1的Dockerfile构建文件):

  1. FROM java:8
  2. RUN apt-get update -yqq \
  3. && apt-get install -yqq \
  4. git
  5. WORKDIR /app/
  6. RUN git clone https://github.com/azkaban/azkaban.git
  7. WORKDIR /app/azkaban
  8. RUN git checkout 3.32.1
  9. RUN bash gradlew build installDist -x test

2. 构建镜像

  1. docker build -f azkaban.Dockerfile -t azkaban-solo:v3.32.1 .
  2. docker images | grep azkaban-solo

3. 启动容器

  1. docker run -itd --name azkaban_docker -p 8081:8081 azkaban-solo:v3.32.1
  2. docker ps |grep azkaban_docker
  3. docker start azkaban_docker
  4. docker restart azkaban_docker
  5. docker stop azkaban_docker
  6. docker rm azkaban_docker

验证

Web UI:http://192.168.216.100:8081
账户口令:azkaban/azkaban**