Code Monkey home page Code Monkey logo

ionic-docker's Introduction

MIT licensed Docker Hub

Ionic-docker

A ionic 1/2 image to be used with Gitlab CI

Inspired by:

Features

  • Node
  • Npm or Yarn
  • Ionic
  • Cordova
  • Android sdk and build tools
  • Ready to run Google Chrome Headless for e2e tests
  • Ruby
  • Scss-lint support

Usage

docker run -ti --rm -p 8100:8100 -p 35729:35729 marcoturi/ionic

If you have your own ionic sources, you can launch it with:

docker run -ti --rm -p 8100:8100 -p 35729:35729 -v /path/to/your/ionic-project/:/myApp:rw marcoturi/ionic

Automation

With this alias:

alias ionic="docker run -ti --rm -p 8100:8100 -p 35729:35729 --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/.gradle:/root/.gradle -v \$PWD:/myApp:rw marcoturi/ionic ionic"

Due to a bug in ionic, if you want to use ionic serve, you have to use --net host option :

alias ionic="docker run -ti --rm --net host --privileged -v /dev/bus/usb:/dev/bus/usb -v ~/.gradle:/root/.gradle -v \$PWD:/myApp:rw marcoturi/ionic ionic"

Know you need gradle for android, I suggest to mount ~/.gradle into /root/.gradle to avoid downloading the whole planet again and again

you can follow the ionic tutorial (except for the ios part...) without having to install ionic nor cordova nor nodejs on your computer.

ionic start myApp tabs
cd myApp
ionic serve
# If you didn't used --net host, be sure to chose the ip address, not localhost, or you would not be able to use it

open http://localhost:8100 and everything works.

Android tests

You can test on your android device, just make sure that debugging is enabled.

cd myApp
ionic cordova platform add android
ionic cordova build android
ionic cordova run android

FAQ

  • The application is not installed on my android device
    • Try docker run -ti --rm -p 8100:8100 -p 35729:35729 --privileged -v /dev/bus/usb:/dev/bus/usb -v \$PWD:/myApp:rw marcoturi/ionic adb devices your device should appear
  • The adb devices show nothing whereas I can see it when I do adb devices on my computer
    • You can't have adb inside and outside docker at the same time, be sure to adb kill-server on your computer before using this image

ionic-docker's People

Contributors

abumalick avatar atefbb avatar marcoturi avatar yukiisbored avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ionic-docker's Issues

adb devices every time requires authorization

Hi,

I am using the command suggested by you do see the adb devices.

docker run -it --rm \
    -p 8100:8100 \
    -p 35729:35729 \
    --privileged \
    -v /dev/bus/usb:/dev/bus/usb \
    -v ~/.gradle:/root/.gradle \
    -v \$PWD:/Sources:rw \
    -v ~/.gitconfig:/root/.gitconfig:ro \
    marcoturi/ionic adb devices

But, everytime i tried to run this command it is generated a new fingerprint.

screenshot_20170712-002635

I checked the checkbox to remeber this computer, but everytime a new fingerprint is created.

Do you have any ideas do avoid this?

Build issue with licences not being accepted

I am having an issue on gitlab ci where the following error is being given when using this image:

WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1.
Android SDK Build Tools 26.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
File /root/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 26.0.2 in /opt/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 26.0.2 not accepted.
Checking the license for package Android SDK Platform 27 in /opt/android-sdk-linux/licenses
Warning: License for package Android SDK Platform 27 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Platform 27, Android SDK Build-Tools 26.0.2].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

Is there a way to lock in the Android Gradle version?

Any advice would be great!

Too many ELOOP errors

Hi, I'm trying to build android app in your image, however running ionic cordova prepare results in below:

ELOOP: too many symbolic links encountered, access '/Sources/node_modules/cordova-plugin-device'

For all dependencies, npm reports similar error as above.

Any solutions?

Docker run can't find ionic.config.json file

First of all thanks for the ionic2-boilerplate. Awesome project!
The docker run command provided in the README do not work for me. Neither

$ pwd
/Users/mavogel/Development/angular/ionic2-boilerplate
$ docker run -ti --rm -p 8100:8100 -p 35729:35729 marcoturi/ionic
******************************************************
 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************
Couldn't find ionic.config.json file. Are you in an Ionic project?

nor

$ docker run -ti --rm -p 8100:8100 -p 35729:35729 -v ~/Development/angular2/ionic2-boilerplate/:/myApp:rw marcoturi/ionic
...

complain about not being in an Ionic project, but I'm definetly in an Ionic project folder:

$ ionic info

Your system information:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: OS X El Capitan
Node Version: v6.9.1
Xcode version: Xcode 8.2.1 Build version 8C1002

Did I miss something? Does this work for you?
https://github.com/agileek/docker you used as inspiration doesn't have related issues. Checked it already

Error: Failed to find package build-tools;25.0.2

Step 8/9 : RUN yes Y | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;25.0.2" "platforms;android-25" "platform-tools"

---> Running in eea0de5cfdac

Warning: File /root/.android/repositories.cfg could not be loaded.

Warning: java.net.UnknownHostException: dl.google.com

Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-3.xml

Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-2.xml

Warning: Failed to connect to host: https://dl.google.com/android/repository/addons_list-1.xml

Warning: Failed to download any source lists!

Error: Failed to find package build-tools;25.0.2

The command '/bin/sh -c yes Y | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;25.0.2" "platforms;android-25" "platform-tools"' returned a non-zero code: 1

Yarn command not found

I'm trying to use the docker image but the Yarn command is not found anymore.
It has been removed from the image in this commit 6fc1c33

Is it possible to start an Ionic project?

Hello, I am currently learning how to use Docker, so I am sorry if this is a dumb question.

For what I've been seen with this image you can only run an existing App but is it possible to start a new project or add dependencies to the project with cordova or npm? If so, how?

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.