Skip to content

Use yj instead of rq, and support ARM architecture #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
FROM alpine:3.12 as rq-build
FROM golang:1.14-alpine as yj-build

ENV RQ_VERSION=1.0.2
WORKDIR /root/

RUN apk --update add upx \
&& wget https://github.com/dflemstr/rq/releases/download/v${RQ_VERSION}/rq-v${RQ_VERSION}-x86_64-unknown-linux-musl.tar.gz \
&& tar -xvf rq-v1.0.2-x86_64-unknown-linux-musl.tar.gz \
&& upx --brute rq
WORKDIR /build
RUN apk add git \
&& git clone https://github.com/sclevine/yj.git && cd yj \
&& go build

FROM library/docker:stable

COPY --from=rq-build /root/rq /usr/local/bin
COPY --from=yj-build /build/yj/yj /usr/local/bin

ENV HOME_DIR=/opt/crontab
RUN apk add --no-cache --virtual .run-deps gettext jq bash tini \
Expand Down
6 changes: 3 additions & 3 deletions docker-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ get_config() {
if [ -f "${HOME_DIR}/config.json" ]; then
jq 'map(.)' ${HOME_DIR}/config.json > ${HOME_DIR}/config.working.json
elif [ -f "${HOME_DIR}/config.toml" ]; then
rq -t <<< $(cat ${HOME_DIR}/config.toml) | jq 'map(.)' > ${HOME_DIR}/config.json
yj -t < ${HOME_DIR}/config.toml | jq 'map(.)' > ${HOME_DIR}/config.json
elif [ -f "${HOME_DIR}/config.yml" ]; then
rq -y <<< $(cat ${HOME_DIR}/config.yml) | jq 'map(.)' > ${HOME_DIR}/config.json
yj -y < ${HOME_DIR}/config.yml | jq 'map(.)' > ${HOME_DIR}/config.json
elif [ -f "${HOME_DIR}/config.yaml" ]; then
rq -y <<< $(cat ${HOME_DIR}/config.yaml) | jq 'map(.)' > ${HOME_DIR}/config.json
yj -y < ${HOME_DIR}/config.yaml | jq 'map(.)' > ${HOME_DIR}/config.json
fi
}

Expand Down