Skip to content

Commit

Permalink
Fix: hadolintのignore
Browse files Browse the repository at this point in the history
- DL3048
  - fly側でLABELを何に使っているか不明なため、変えないでおく。
- DL3008
  - BUILD_PACKAGES,DEPLOY_PACKAGESが変数だとhadolintで解析できない。
  - また、バージョン指定したことで急に動かなくなること(#512)があると困るので、パッケージのバージョンは指定しないでおく。
- DL3025
  - SERVER_COMMANDが変数だとhadolintで解析できない。
  - さらにSERVER_COMMANDはfly.tomlからオーバーライドされ、チェックが意味を成さなくなるのでignoreする。
  • Loading branch information
momocus committed Nov 22, 2022
1 parent 4ad9f4c commit 654195c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fly.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ARG RUBY_VERSION=3.1.2
ARG VARIANT=jemalloc-slim
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base

# hadolint ignore=DL3048
LABEL fly_launch_runtime="rails"

ARG NODE_VERSION=18.*
Expand All @@ -42,6 +43,7 @@ RUN mkdir /app
WORKDIR /app
RUN mkdir -p tmp/pids

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl https://get.volta.sh | bash
ENV VOLTA_HOME /root/.volta
ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH
Expand All @@ -58,6 +60,7 @@ FROM base as build_deps
ARG BUILD_PACKAGES="build-essential libpq-dev"
ENV BUILD_PACKAGES ${BUILD_PACKAGES}

# hadolint ignore=DL3008
RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
apt-get update -qq && \
Expand Down Expand Up @@ -93,6 +96,7 @@ FROM base
ARG DEPLOY_PACKAGES="postgresql-client"
ENV DEPLOY_PACKAGES=${DEPLOY_PACKAGES}

# hadolint ignore=DL3008
RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt \
apt-get update -qq && \
Expand Down Expand Up @@ -133,4 +137,5 @@ RUN ${BUILD_COMMAND}
ENV PORT 8080
ARG SERVER_COMMAND="bin/rails fly:server"
ENV SERVER_COMMAND ${SERVER_COMMAND}
# hadolint ignore=DL3025
CMD ${SERVER_COMMAND}

0 comments on commit 654195c

Please sign in to comment.