1

When I execute docker build . in the directory with the Dockerfile below, I get the following error:

Error response from daemon: Unknown instruction: &&

Why doesn't the && in my Dockerfile work? I see it used all the time in other Dockerfiles to string together commands.

I'm using Docker version 1.13.1, build 47e2230/1.13.1 on Fedora 30.

Dockerfile:

FROM ubuntu:16.04

RUN apt-get update && apt-get install -y \
    curl \
    && mkdir -p /opt/google/
    && curl -sSL "https://dl.google.com/dl/android/studio/ide-zips/3.5.0.21/android-studio-ide-191.5791312-linux.tar.gz" -o /opt/google/android-studio.tar.gz \
    && tar -xzf /opt/google/android-studio.tar.gz \
    && cd /opt/google/android-studio/bin/./studio.sh \
    && rm /opt/google/android-studio.tar.gz \
    && echo "PATH=${PATH}:/opt/google/android-studio/bin" >> ~/.profile
2
  • Missing "\" after mkdir -p /opt/google/, perhaps? Also, I find the curl on its own line rather disturbing.
    – xenoid
    Commented Sep 7, 2019 at 6:09
  • Thanks. I was missing "\". This is why I should stop looking at text after midnight. Commented Sep 7, 2019 at 14:43

1 Answer 1

3

The line && mkdir -p /opt/google/ is missing a \ at the end.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .