dimanche 1 septembre 2019

Cannot get flutter running in Docker

My Dockerfile

FROM ubuntu:18.04

# Project files
ARG PROJECT_DIR=/srv/api
RUN mkdir -p $PROJECT_DIR

WORKDIR $PROJECT_DIR


# Update
RUN apt-get -y upgrade
RUN apt-get update

RUN apt-get install -y xz-utils
RUN apt-get install -y curl
RUN curl https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_v1.7.8+hotfix.4-stable.tar.xz -o /flutter.tar.xz
RUN tar xf /flutter.tar.xz 
#RUN mv flutter /srv/api/flutter
RUN ls /srv/api/flutter
RUN chmod a+x /srv/api/flutter
RUN flutter doctor

# Install Flutter dependencies
RUN flutter upgrade
RUN flutter packages pub global activate webdev
RUN flutter packages upgrade


# Copy everything to Docker
COPY ./ ./

Fails at RUN flutter doctor

If I put in path /srv/api/flutter I receive error flutter: not found. If I put in path /usr/local/bin/flutter I receive error flutter: Permission Denied.

I tried putting it in regular directory and in /usr directory. Both ways have failed. I tried searching about it but nothing seems to be working.

How can I fix it?




Aucun commentaire:

Enregistrer un commentaire