Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

0
1

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 3 years have passed since last update.

Dockerエラー:Syntax error - can't find = in "RUN" の解決策

Last updated at Posted at 2021-03-24

Dockerビルド中に起きたエラーの解決策です。

#エラー内容

$ docker-compose build
failed to solve with frontend dockerfile.v0: failed to create LLB definition: Syntax error - can't find = in "RUN". Must be of the form: name=value

どうやら "RUN" で Syntax error が起きている様子。

#問題となったDockerfile

FROM node:12.5.0-alpine

WORKDIR /app

ENV LANG=C.UTF-8 \
    TZ=Asia/Tokyo

RUN apk update && \
    apk upgrade && \
    npm install -g n && \
    npm install -g create-nuxt-app && \
    yarn install &&\
    rm -rf /var/cache/apk/* \   ← 改行が入っている!

ADD . /app
~                   

#問題が解決されたDockerfile

FROM node:12.5.0-alpine

WORKDIR /app

ENV LANG=C.UTF-8 \
    TZ=Asia/Tokyo

RUN apk update && \
    apk upgrade && \
    npm install -g n && \
    npm install -g create-nuxt-app && \
    yarn install &&\
    rm -rf /var/cache/apk/*    ← 改行を消しました!

ADD . /app    ​
$ docker-compose build
[+] Building 30.1s (10/10) FINISHED  
 => (中略)
Successfully built 999eaa37e4901ef302ab6634715b5a0bc0829b8c9eec7dbcb05a3f4d1ed84bff

無事に通った。基本的なことを大事にしていきたいです。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?