Commit Graph

97 Commits

Author SHA1 Message Date
Justin Cormack
9d64a6dea2 Stop using dhcp ntp and fix the options used on OSX
The options added in de6e7f9cbe
were not applied for ntp configured servers.

As the address is always the same, stop using dhcp and just hard code this.
This should make sync work how it used to, ie quite well.

Also trust the GCP ntp server, as it is local and provided by infrastructure.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-02-15 17:54:41 +00:00
Justin Cormack
792398346e Minimise the motd
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-31 21:02:57 +00:00
Riyaz Faizullabhoy
3cf8ac1c95 Add fs link protection sysctls
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2017-01-18 15:20:40 +00:00
Justin Cormack
83a9cf6622 Combine sysctl configs
Where the suggestions came from is not that useful, just have a
single file for the main ones and then distro specific versions.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-10 11:40:36 +00:00
Riyaz Faizullabhoy
fe62e3eed8 Add kspp recommended sysctl settings
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-12-22 10:00:22 -08:00
Justin Cormack
1991c29ab7 Fix the cgroup memory hierarchy warning
Needed to make the memory cgroup work properly

fix #373

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-12-22 00:21:47 +00:00
Riyaz Faizullabhoy
1b98dbb6e2 Only disable sysrq for cloud editions
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-12-16 09:24:34 -08:00
Justin Cormack
9897241118 Improve mkfs options
- make quiet
- force, so some adjustments are not checked see https://github.com/docker/pinata/issues/6198
- set resize_inode as we do resize partitions on cloud and they could have very few inodes otherwise
- inline all the default options and remove the config file, so script is more standalone

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-12-12 10:36:49 -08:00
Riyaz Faizullabhoy
2e8a6143dd Disable kexec from kernel_config, revert sysctl config because key is now unknown
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-12-07 11:43:10 -08:00
Justin Cormack
dbe24caa57 Merge pull request #840 from riyazdf/kexec-load
Disable kexec load in sysctl config
2016-12-07 10:44:44 -08:00
Justin Cormack
f2c2534608 Only TRIM on Mac if configured via database
Stops unnecessary log spam.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-12-06 08:50:45 -08:00
Justin Cormack
a5fa2fa133 Typo in crontab
Its 15min not 15m

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-12-06 08:37:04 -08:00
David Scott
40e7dbbf8b Use TRIM on Mac as well as Windows
Previously we only ran `fstrim` on Windows. Docker for Mac now supports
TRIM so we should run `fstrim` there too.

Note it's possible to turn off TRIM on the Mac at the virtual hardware
level via the database, but this should be harmless -- the `fstrim`
fails immediately with an obvious error if the device doesn't support it:
`fstrim: ioctl 0xc0185879 failed: Not supported`.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-12-06 12:03:26 +00:00
Riyaz Faizullabhoy
0b4f1ab5f4 Disable kexec load in sysctl config
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-12-05 09:26:17 -08:00
Justin Cormack
bf1c21e045 Run rngd inside a system container
- this needs an init as it does not respond to stop signals, so include tini
- needs CAP_SYS_ADMIN to write to kernel entropy estimate
- set kernel.random.write_wakeup_threshold so that rngd does not need sysctl write access
- build patches from Alpine, but statically linked
- remove rngd from base image, means we no longer need community repository

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-12-02 14:00:12 +00:00
Riyaz Faizullabhoy
fdffacd809 Add sysctl changes as suggested by lynis
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-12-01 15:41:57 -08:00
Justin Cormack
1265e910ff Merge pull request #806 from riyazdf/disable-kernel-modules
Disable kernel modules for cloud editions from moby
2016-11-28 16:07:03 -08:00
Riyaz Faizullabhoy
0a265fa521 Disable kernel modules for cloud editions from moby by checking in
a modified sysctl init with a cloud config

Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-11-28 15:40:02 -08:00
Justin Cormack
1f87461538 Add a tmpfs at /tmp
This makes sure that once we have ro rootfs any programs that still
for any reason use `/tmp` can still write to it, or if people expect
sharing it into a container to work.

fix #778

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-25 17:05:45 +00:00
Justin Cormack
de7bc5103d Make /run nosuid,noexec
This was not sufficiently locked down.

Fix #720

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-23 12:08:53 +00:00
Justin Cormack
3dc7419954 Run TRIM on Windows every 15m
As the Windows virtual device supports TRIM we can run this to free
up disk space frequently. Not recommended to run on physical devices
this often.

See https://github.com/docker/pinata/issues/5298

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-23 11:30:35 +00:00
Justin Cormack
a85dbe129d Use syslog local0 for docker logs
This allows log rotation, redirect via syslog etc.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-18 16:23:41 +00:00
Justin Cormack
5ee7875ac4 Remove syslog conf file
We are not using busybox syslog any more so this is unused.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-18 16:23:41 +00:00
Justin Cormack
a3cb39e21a Rework moving automount earlier in boot sequence
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-15 09:54:07 +00:00
Justin Cormack
96399432f3 Fix /run symlink issues
- run bootmisc before sysklogd so symlinks from /var/run to
  /run are created
- recreate symlinks that bootmisc created when we remount /var
  until this gets moved earlier

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-14 22:00:12 +00:00
Justin Cormack
bf2ee91861 Revert "Use /run for pidfiles for sysklogd"
This reverts commit b8ff787239.

syslogd always uses /var/run internally, need to fix symlinks.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-14 19:55:07 +00:00
Justin Cormack
b8ff787239 Use /run for pidfiles for sysklogd
This is the real location, and /var may be overmounted.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-14 18:38:37 +00:00
Justin Cormack
2174a9371b Always start vsudd before syslog
If we are using vsudd to forward syslog to the host, as on osx,
we need to start it before syslog starts, and make sure it has
created its socket.

Add a pidfile to vsudd to make startup more reliable.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-14 17:08:37 +00:00
Justin Cormack
8dbaef8b9c Revert "Format filesystems earlier, before syslog"
This reverts commit 4dd5dca106.

Fix #710 where system hangs after klogd startup on AWS. Possibly
also affects Windows too. Still unclear why but lets revert and
continue investif=gating.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-12 15:29:27 +00:00
Justin Cormack
4dd5dca106 Format filesystems earlier, before syslog
So that we can write to /var early, move filesystem formatting as early as possible.

Adds a dummy fsck service, as we already do fsck in format script.

Replaces #535

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-11-08 15:20:46 +00:00
Justin Cormack
248a3c39f9 Increase neighbor cache threshold values
Needed for larger clusters.

Needed for https://github.com/docker/editions/issues/377

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-10-28 22:25:36 +01:00
Justin Cormack
b9273e5549 Support memory overcommit
One less complaint in Redis startup.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-10-05 11:46:58 +02:00
Justin Cormack
131122c3b2 Add weekly cron job to TRIM drive
See #536

This is the recommended frequency. For desktop this might be less
suitable, so we may want to adjust

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-09-24 14:18:49 +01:00
Justin Cormack
a2c3991580 Switch to dhcpcd
Should fix issue with not sending hostname which Azure needs.

This should be requesting all the dhcp features we currently use.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-09-23 15:52:30 +01:00
Rolf Neugebauer
aceebda3db net: consolidate DHCP onto eth0 only
- rename DfW main interface eth0
- remove eth1 DHCP config
- create tap device in init script not interfaces file

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-09-22 18:12:45 +01:00
Rolf Neugebauer
a0632f1e78 net: rename Hyper-V internal network to hvint0 and configure it
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-09-22 16:17:26 +01:00
Justin Cormack
0847d0419e Increase default fs.aio-max-nr
As recommended by Oracle for MySQL.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-09-19 23:38:26 +01:00
Justin Cormack
1aef768a33 Add rngd
Tweak the config to use RDSEED or (fallback) RDRAND. Makes sure
we have initial random seed in cases where there is no other
random source if these are supported.

The default config in Alpine currently disables these, which makes
it pretty useless, as there is no motherboard rng support any more.

Replaces #517
Fix #514
Fix #183

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-09-16 15:32:56 +01:00
Justin Cormack
37fe023e06 Do not prompt for username at login
Given you can login as root with no password on the console,
asking which user you would like to login as is rather pointless.

Do have to tweak /etc/issue though as busybox getty does not display it
without a prompt, and we want a whale.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-09-14 11:38:55 +00:00
David Scott
dd761f9e04 dhcp: request search domains (DHCP option 119)
Signed-off-by: David Scott <dave.scott@docker.com>
2016-08-31 14:06:55 +01:00
Justin Cormack
3f381afbfb Fix shared mount of /run
Needs util-linux for now, see https://github.com/docker/moby/issues/424

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-08-22 23:04:57 +01:00
Justin Cormack
6fbd9f1ca4 Busybox mount will not mount shared, so add a bind
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-08-22 19:09:24 +01:00
Sebastiaan van Stijn
b8c3c99e5e remove "alpha" from motd
commit 3eae35d77b removed
"alpha" from "issue", but missed removing it here.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-08-13 20:20:03 +02:00
Justin Cormack
c0579f4b83 Add default sysfs settings
This uses the new Alpine sysfs.conf service to allow config of sysfs.

Default file that sets transparent huge pages to only be used on request
to fix #368

Database setting available for user configuration.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-08-12 14:13:40 +01:00
Justin Cormack
6655cc9919 Not alpha any more, missed this
Signed-off-by: Justin Cormack <justin@specialbusservice.com>
2016-08-12 09:40:16 +01:00
Justin Cormack
4c63ca4ce6 Merge pull request #397 from nathanleclaire/kickup_dhcp_timeouts
Increase DHCP timeout and retries
2016-08-09 16:18:25 +01:00
Justin Cormack
9fdb923056 Mount /run as shared
This is needed for volume drivers as they will mount their
volumes under here, and if they are running in a container
docker on the host will need to see these.

Also provide our own fstab, removes the media devices that were
there previously.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-08-09 11:46:08 +01:00
Nathan LeClaire
c7f289e395 Increase DHCP timeout and retries
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2016-08-08 17:41:46 -07:00
Justin Cormack
adcfa94158 use openrc for shutdown
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-21 12:57:05 +01:00
Justin Cormack
b3b38aacc1 Use upstream /etc/securetty
Now we modify the file if we use a different console, can use
upstream unmodified.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-15 11:58:01 +01:00