Skip to content

Commit

Permalink
add hadolint
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu-g committed Nov 18, 2023
1 parent abf3dad commit e01d019
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ignored:
- DL3008 # Pin versions in apt get install
- DL3006 # Always tag the version of an image explicitly
- DL3003 # Use WORKDIR to switch to a directory
- DL3013 # Pin versions in pip
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-yaml
# - repo: https://github.com/hadolint/hadolint
# rev: v2.12.0
# hooks:
# - id: hadolint
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,36 @@ RUN apt-get update -q && apt-get install -yq --no-install-recommends \
cmake \
libprotobuf-dev \
wget \
curl \
tar \
xz-utils \
ca-certificates \
zlib1g-dev \
libtool \
automake \
autoconf \
git \
unzip
unzip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Build and install Juman++
RUN wget "https://github.com/ku-nlp/jumanpp/releases/download/v${JPP_VERSION}/jumanpp-${JPP_VERSION}.tar.xz" -qO - \
| tar Jxf - \
&& mkdir "jumanpp-${JPP_VERSION}/bld" \
&& cd "jumanpp-${JPP_VERSION}/bld" \
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
&& make -j "$(nproc)" \
&& make -j "$([ "$(nproc)" -le 8 ] && nproc || echo "8")" \
&& make install

# Build and install KNP
RUN git clone --depth 1 https://github.com/ku-nlp/knp.git \
&& cd knp \
&& ./autogen.sh \
&& wget -q http://lotus.kuee.kyoto-u.ac.jp/nl-resource/knp/dict/latest/knp-dict-latest-bin.zip \
RUN git clone --depth 1 "https://github.com/ku-nlp/knp.git"
WORKDIR /app/knp
RUN ./autogen.sh
RUN wget -q "http://lotus.kuee.kyoto-u.ac.jp/nl-resource/knp/dict/latest/knp-dict-latest-bin.zip" \
&& unzip knp-dict-latest-bin.zip \
&& rm -f knp-dict-latest-bin.zip \
&& cp -ars "$(pwd)"/dict-bin/* ./dict \
&& ./configure \
&& make -j "$(nproc)" \
&& make -j "$([ "$(nproc)" -le 8 ] && nproc || echo "8")" \
&& make install

FROM ${BASE_IMAGE} AS runner
Expand Down
2 changes: 1 addition & 1 deletion jumanpp-knp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN apt-get update -q && apt-get install -yq --no-install-recommends \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Build and install KNP
RUN git clone --depth 1 https://github.com/ku-nlp/knp.git
RUN git clone --depth 1 "https://github.com/ku-nlp/knp.git"
WORKDIR /app/knp
RUN ./autogen.sh
RUN wget -q "http://lotus.kuee.kyoto-u.ac.jp/nl-resource/knp/dict/latest/knp-dict-latest-bin.zip" \
Expand Down

0 comments on commit e01d019

Please sign in to comment.