Commit Graph

265 Commits

Author SHA1 Message Date
Girish Ramakrishnan
7ef6bd0d3f Add readonlyRootfs flag to apps table
When turned off, it will put the app in a writable rootfs. This
allows us to debug live/production apps (like change start.sh) and
just get them up and running. Once turned off, this app cannot be
updated anymore (unless the force flag is set). This way we can
then update it using the CLI if we are convinced that the upcoming
update fixes the problem.

Part of #171
2017-01-19 11:55:25 -08:00
Girish Ramakrishnan
ea0e61e6a4 Remove unused function 2017-01-19 09:12:54 -08:00
Johannes Zellner
4579de85bf Only log exposed ports if there are any 2016-11-16 22:18:12 +01:00
Girish Ramakrishnan
6c1c7e74c1 detect if aa is available (linode has it disabled) 2016-10-08 23:04:24 -07:00
Girish Ramakrishnan
1e744c24f0 Fix typo 2016-10-03 15:08:21 -07:00
Girish Ramakrishnan
7b4c9dffab fix memoryLimit handling
0 means not set. and it will follow value in manifest

part of #18
2016-09-04 11:38:54 -07:00
Girish Ramakrishnan
21c5033e34 remove unused variable 2016-07-13 10:16:45 -07:00
Girish Ramakrishnan
3ec29dc9e1 Do not set hostname of app containers
do no set hostname of containers to location as it might conflict with addons names. for example, an app installed in mail
location may not reach mail container anymore by DNS. We cannot set hostname to fqdn either as that sets up the dns
name to look up the internal docker ip. this makes curl from within container fail
Note that Hostname has no effect on DNS. We have to use the --net-alias for dns.
Hostname cannot be set with container NetworkMode
2016-06-18 17:53:54 -05:00
Girish Ramakrishnan
de0d42e52f search cloudron network for the apps 2016-06-17 09:18:15 -05:00
Girish Ramakrishnan
d51d2e5131 start addons and apps in the cloudron network
also remove getLinkSync, since we don't use linking anymore
2016-06-17 09:18:10 -05:00
Girish Ramakrishnan
0bb6d969a4 inject altDomain in the APP_ORIGIN and APP_DOMAIN env vars 2016-04-25 10:52:12 -07:00
Girish Ramakrishnan
3215d4a3c9 move the exports to the top 2016-04-18 16:30:58 -07:00
Girish Ramakrishnan
6b1e14b464 add option to buffer stdout 2016-04-18 15:02:31 -07:00
Girish Ramakrishnan
a2096bec18 use options.stdout to pass back result 2016-04-18 12:22:42 -07:00
Girish Ramakrishnan
4f82bcec43 make execContainer take options arg 2016-04-18 11:42:34 -07:00
Girish Ramakrishnan
87c5371603 use docker exec instead of dockerode exec in mysql
this way we can check the exit code of the exec process.
preivously, we were only wait for the stream to end.
2016-04-18 11:06:09 -07:00
Girish Ramakrishnan
60badce935 add docker.execContainer 2016-04-18 10:32:22 -07:00
Johannes Zellner
ecf7f442ba Add docker.getContainerIdByIp() 2016-02-18 15:39:27 +01:00
Johannes Zellner
5f96d862ab Move default memory limit to constants.js 2016-02-14 12:13:49 +01:00
Johannes Zellner
71bfc1cbda Ensure we never go below minimum memoryLimit 2016-02-11 18:13:42 +01:00
Johannes Zellner
75d22d7988 Introduce memoryLimit to apps routes 2016-02-11 17:00:21 +01:00
Johannes Zellner
1cdb64e78d Use memoryLimit from app object instead of manifest in docker.js 2016-02-10 12:25:26 +01:00
girish@cloudron.io
b9d4b8f6e8 Remove docker images by tag
docker pull previously used to pull down all tags.
    docker pull tag1 # might pull down tag2, tag3 if they are all same!
    docker rm tag1 # oops, tag2 and tag3 still hold on to the image

However, the above feature was not possible with registry v2 (some
technical stuff to do with each tag being separately signed). As a result,
this feature was removed from v1 as well - https://github.com/docker/docker/pull/10571

This means we can now do:
    docker pull tag1 # nice
    docker rm tag1 # image goes away if no one else is using it

references:
https://github.com/docker/docker/issues/8689
https://github.com/docker/docker/pull/8193 (added this feature to v1)
https://github.com/docker/docker/issues/8141 (the request)
https://github.com/docker/docker/pull/10571 (removes the v1 feature)

Fixes #563
2016-01-21 15:53:51 -08:00
girish@cloudron.io
67b94c7fde give message for development mode 2016-01-19 10:20:24 -08:00
girish@cloudron.io
28baef8929 Go back to using docker exec in cloudron exec
The main issue is that multiple cloudron exec sessions do not
share the same rootfs. Which makes it annoying to debug.

We also have some nginx timeout which drops you out of exec
now and then resulting in loss of all state.
2016-01-15 15:24:46 -08:00
girish@cloudron.io
9b061a4c7c make the command work 2016-01-15 14:50:13 -08:00
girish@cloudron.io
0b542dfbdf Pause app container in developmentMode
This allows us to share the network namespace with the app container
2016-01-15 14:34:15 -08:00
girish@cloudron.io
d3b039ebd8 support developmentMode flag
- disables readonly rootfs
- disables memory limit
2016-01-15 11:28:43 -08:00
Girish Ramakrishnan
07e322df96 default targetBoxVersion to the maximum possible version ever
Apps that do not provide a targetBoxVersion are assumed to be
capable of running everywhere.
2015-12-27 16:43:50 -08:00
Girish Ramakrishnan
8539d4caf1 scheduler: delete containers by name
scheduler.json gets nuked during updates. When the box code restarts,
the scheduler is unable to remove old container because the state file
scheduler.json is now gone. It proceeds to create new container but that
does not work because of name conflict.

Fixes #531
2015-12-23 13:23:49 -08:00
Girish Ramakrishnan
5b8fdad5cb Revert "remove targetBoxVersion checks since all apps are now ported"
This reverts commit d104f2a077.

gitlab is not ported :-(
2015-12-05 02:29:06 -08:00
Girish Ramakrishnan
24d3a81bc8 remove targetBoxVersion checks since all apps are now ported 2015-12-02 15:02:16 -08:00
Girish Ramakrishnan
268c7b5bcf always create an isolated network ns 2015-12-01 13:59:45 -08:00
Girish Ramakrishnan
64716a2de5 cloudron exec: disable links for subcontainers
Dec 01 08:36:53 girish.cloudron.us node[5431]: Error: HTTP code is 409 which indicates error: undefined - Conflicting options: --net=container can't be used with links. This would result in undefined behavior
2015-12-01 00:51:41 -08:00
Girish Ramakrishnan
df8653cdd5 Do not set Hostname for subcontainers 2015-11-26 19:26:29 -08:00
Girish Ramakrishnan
32f677ca0d make app subcontainers share network namespace with app
pid namespace sharing is coming in https://github.com/docker/docker/issues/10163
2015-11-26 19:18:31 -08:00
Girish Ramakrishnan
6bd9173a9d this docker registry keeps going down 2015-11-12 16:22:53 -08:00
Girish Ramakrishnan
6bd68961d1 typo 2015-11-12 16:13:15 -08:00
Girish Ramakrishnan
7cd89accaf better pullImage debug output 2015-11-12 15:58:39 -08:00
Girish Ramakrishnan
3766d67daa create new container from cloudron exec 2015-11-10 21:36:20 -08:00
Girish Ramakrishnan
316e8dedd3 name is a query parameter 2015-11-02 14:08:34 -08:00
Girish Ramakrishnan
95b2bea828 Give containers a name 2015-11-02 09:34:31 -08:00
Girish Ramakrishnan
dd2a806ab8 Do not set hostname of app container
Some apps like pasteboard try to curl the public app url from inside
the container. This fails because we set the hostname and the hostname
maps to the internal docker IP.

To fix this, simply export two environment variables providing the
app's domain and origin. The hostname is set to the app location instead
of the FQDN for debugging.

Fixes #521
2015-10-23 16:17:35 -07:00
Girish Ramakrishnan
1a2948df85 VolumesFrom is part of HostConfig 2015-10-20 17:34:47 -07:00
Girish Ramakrishnan
14bc2c7232 rename isSubcontainer -> isAppContainer 2015-10-20 10:55:06 -07:00
Girish Ramakrishnan
76d286703c ignore portBindings and exportPorts for subcontainers 2015-10-20 10:42:35 -07:00
Girish Ramakrishnan
c80a5b59ab do not dump containerOptions 2015-10-20 10:27:53 -07:00
Girish Ramakrishnan
fb2e7cb009 scheduler: crash fixes 2015-10-20 09:36:30 -07:00
Girish Ramakrishnan
daba68265c stop all containers of an app 2015-10-20 00:05:19 -07:00
Girish Ramakrishnan
6d04481c27 fix debug tag 2015-10-19 23:38:55 -07:00