6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Embulk × Digdag on Docker

Last updated at Posted at 2019-04-08
Dockerfile
FROM centos:latest

WORKDIR /embulk_digdag

# java
RUN yum update -y && yum install -y \
      java-1.8.9-openjdk \
      java-1.8.0-openjdk-devel \
      vim

ENV TD_API_KEY='td_api_key' \
    AWS_ACCESS_KEY_ID='aws_access_key' \
    AWS_SECRET_ACCESS_KEY='aws_secret_access_key'

# treasure data toolbelt
RUN curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent2.sh | sed -e "s/sudo//g" | /bin/bash && \
    td apikey:set $TD_API_KEY

# embulk
RUN curl --create-dirs -o ~/.embulk/bin/embulk -L "https://dl.embulk.org/embulk-latest.jar" &&\
    chmod +x ~/.embulk/bin/embulk && \
    echo 'export PATH="$HOME/.embulk/bin:$PATH"' >> ~/.bashrc && \
    source ~/.bashrc && \
    embulk gem install embulk-input-mysql embulk-output-td embulk-input-s3 embulk-filter-column embulk-filter-add_time

# digdag
RUN curl -o ~/bin/digdag --create-dirs -L "https://dl.digdag.io/digdag-latest" && \
    chmod +x ~/bin/digdag && \
    echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc && \
    source ~/.bashrc && \
    mkdir -p ~/.config/digdag; touch ~/.config/digdag/config && \
    echo "client.http.endpoint = https://digdag.サーバー名.com" >> ~/.config/digdag/config

# digdag path
ENV PATH /root/bin:${PATH}

# aws cli
RUN set -xv && \
    curl -s "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" && \
    python get-pip.py && \
    pip install awscli --ignore-installed six && \
    curl -s -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | sh && \
    source ~/.nvm/nvm.sh && \
    nvm install v6.10.3 && \
    npm install -g jsonlint && \
    npm install -g jq

RUN digdag secrets --local --set td.apikey=${TD_API_KEY} && \
    digdag secrets --local --set aws.access_key_id=${AWS_ACCESS_KEY_ID} && \
    digdag secrets --local --set aws.secret_access_key=${AWS_SECRET_ACCESS_KEY}

docker-compose.yml
version: '3'
services:
  app:
    build: .
    volumes:
      - .:/embulk_digdag
    tty: true
    environment:
      TZ: Asia/Tokyo
# docker-compose up -d
docker exec -it コンテナID /bin/bash
# embulk --version
embulk 0.9.17
# digdag --version
0.9.35
# aws --version
aws-cli/1.16.140 Python/2.7.5 Linux/4.9.125-linuxkit botocore/1.12.130
6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?