# La imagen de Docker incluye el repositorio "restricted" (no libre) de Ubuntu, que no es necesario

**URL:** <https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931>\
**Category:** Development\
**Created:** [1 Junio, 2018 16:08 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931 "2018-06-01T16:08:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudoman](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sudoman](https://meta.discourse.org/u/sudoman)\
**Post date:** [1 Junio, 2018 16:08 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/1 "2018-06-01T16:08:57Z")

</div>

Hello Discourse team,

I did a quick peek at `/etc/apt/sources.list` and found this list:

```plaintext
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe

```

The `restricted` repo contains non-free software.

I installed the `vrms` tool and after running it, it tells me that there are no proprietary packages in the docker image. The non-free restricted repo is primarily for those who want to install non-free drivers, so there should be no practical use of this repo by Discourse.

According to [https://meta.discourse.org/t/does-the-discourse-team-distribute-proprietary-versions-of-discourse/87864/2](https://meta.discourse.org/t/does-the-discourse-team-distribute-proprietary-versions-of-discourse/87864/2), Discourse doesn’t distribute non-free software.

Could you please edit your `sources.list` file so that it does not open the door to accidentally installing packages from the `restricted` repository? I would really appreciate that. 🙂

Thanks,  
Andrew

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [1 Junio, 2018 16:45 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/2 "2018-06-01T16:45:48Z")

</div>

I believe this come from our upstream docker image, at this line

> <https://github.com/discourse/discourse_docker/blob/master/image/base/Dockerfile#L3>

That line points to the official Ubuntu image from the Docker library which has this line:

> <https://github.com/tianon/docker-brew-ubuntu-core/blob/dist-amd64/xenial/Dockerfile#L2>

where it adds [this archive](https://github.com/tianon/docker-brew-ubuntu-core/blob/dist-amd64/xenial/ubuntu-xenial-core-cloudimg-amd64-root.tar.gz) that contains the restricted lines you found.

I don’t know if there is an official Ubuntu docker image with those disabled.

---

<div class="post-metadata">

**Author:** ![sudoman](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sudoman](https://meta.discourse.org/u/sudoman)\
**Post date:** [1 Junio, 2018 17:09 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/3 "2018-06-01T17:09:57Z")

</div>

Thanks for the links @Flaco. Does this line and those that follow override those settings?

[https://github.com/discourse/discourse\_docker/blob/master/image/base/Dockerfile#L15](https://github.com/discourse/discourse_docker/blob/master/image/base/Dockerfile#L15)

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [1 Junio, 2018 17:16 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/4 "2018-06-01T17:16:39Z")

</div>

Oops, I totally missed that 😊.

Yeah, so we are overwriting the Ubuntu defaults there.

Maybe try to build the image without the restricted bits and run the tests to see if everything pass?

---

<div class="post-metadata">

**Author:** ![sudoman](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sudoman](https://meta.discourse.org/u/sudoman)\
**Post date:** [9 Agosto, 2018 15:11 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/5 "2018-08-09T15:11:25Z")

</div>

Hello Rafael,

Thanks for your reply. I edited that file so only “main” repos would be included, but “universe” and “restricted” came back in anyhow. I’ll do some more testing to see if I can get it to work.

Thanks,  
Andrew

---

<div class="post-metadata">

**Author:** ![sudoman](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sudoman](https://meta.discourse.org/u/sudoman)\
**Post date:** [16 Agosto, 2018 21:47 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/6 "2018-08-16T21:47:25Z")

</div>

Hello Rafael,

I managed to build the image with `main` and `universe` only. `universe` is required because discourse installs at least one package from there: `fping`.

How do I run automated tests for the system?

Thanks,  
Andrew

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [16 Agosto, 2018 21:51 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/7 "2018-08-16T21:51:57Z")

</div>

For tests we build another image using the one you just built as a base.

Running `ruby auto_build.rb discourse_test` will build it.

---

<div class="post-metadata">

**Author:** ![sudoman](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sudoman](https://meta.discourse.org/u/sudoman)\
**Post date:** [17 Agosto, 2018 16:27 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/8 "2018-08-17T16:27:11Z")

</div>

Hello Rfael,

Thanks for those instructions. `discourse_test` wasn’t an option, so I went with `discourse_test_build` instead of `discourse_test_public`.

I don’t see instructions for running automated tests in the `README` file, so I experimented a bit. I saw these lines in the output of `docker images`:

```
REPOSITORY TAG IMAGE ID CREATED SIZE
discourse/discourse_test build 683b0277af9f About an hour ago 3.7GB
local_discourse/app latest 49278c40bf4c 19 hours ago 2.6GB
...

```

So I changed this line in `./launcher`

```
#local_discourse=local_discourse
local_discourse=discourse

```

I copied `containers/app.yml` to `containers/discourse_test.yml` and ran

```
./launcher start discourse_test

```

But I got this error:

```
...
Unable to find image 'discourse/discourse_test:latest' locally
/usr/bin/docker: Error response from daemon: manifest for discourse/discourse_test:latest not found.
See '/usr/bin/docker run --help'.

```

I couldn’t find the text `tag` or `latest` in the `./launcher` file or the `docker run` man page, so I’m still not sure how to specify `build` rather than `latest` in `./launcher`. I checked `image/auto_build.rb` and it looks like the other option is to build `discourse_test_public`, but that is tagged as `release`, not `latest`, so it’s not clear how to spin up one of the test images and to run the automated tests. Do you know how to do this?

Thanks,  
Andrew

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [17 Agosto, 2018 16:38 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/9 "2018-08-17T16:38:26Z")

</div>

After building the image locally you can run tests with:

```
docker run --rm discourse/discourse_test:build

```

---

<div class="post-metadata">

**Author:** ![sudoman](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sudoman](https://meta.discourse.org/u/sudoman)\
**Post date:** [17 Agosto, 2018 19:24 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/10 "2018-08-17T19:24:25Z")

</div>

I ran the tests and got the following error. Was the random seed generation too slow, causing the test suite to time out and abort? There were other randomly generated seeds before this. This vm only has two virtual CPUs, but I can increase that number.

```
...
Finished in 6 minutes 10 seconds (files took 21.73 seconds to load)
260 examples, 0 failures

Randomized with seed 36421

yarn install v1.9.4
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.50s.
Puma starting in single mode...
* Version 3.11.4 (ruby 2.5.1-p57), codename: Love Song
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:60099
Use Ctrl-C to stop
node /var/www/discourse/vendor/assets/javascripts/run-qunit.js http://localhost:60099/qunit?seed=137594233159754697689085641368770876532 600000
Warming up Rails server
Rails server is warmed up
navigate to http://localhost:60099/qunit?seed=137594233159754697689085641368770876532
DEBUG: -------------------------------
DEBUG: Ember : 2.13.3
DEBUG: jQuery : 3.3.1
DEBUG: -------------------------------

Running: {"seed":"137594233159754697689085641368770876532"}

.............................................F........................................................................................................................................
...........................................................................................................................................................F..........................
.....................................................................F................................................................................................................
........................................................Tests timed out
rake aborted!
Command failed with status (124): [node /var/www/discourse/vendor/assets/java...]
/var/www/discourse/lib/tasks/qunit.rake:89:in `block in <main>'
/var/www/discourse/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => qunit:test
(See full trace by running task with --trace)
115:signal-handler (1534527556) Received SIGTERM scheduling shutdown...
2018-08-17 17:39:16.546 UTC [134] LOG: received smart shutdown request
2018-08-17 17:39:16.594 UTC [134] LOG: worker process: logical replication launcher (PID 143) exited with exit code 1
2018-08-17 17:39:16.602 UTC [138] LOG: shutting down
115:M 17 Aug 17:39:16.611 # User requested shutdown...
115:M 17 Aug 17:39:16.612 # Redis is now ready to exit, bye bye...
2018-08-17 17:39:17.114 UTC [134] LOG: database system is shut down
Terminating

```

---

<div class="post-metadata">

**Author:** ![sudoman](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@sudoman](https://meta.discourse.org/u/sudoman)\
**Post date:** [28 Agosto, 2018 20:06 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/11 "2018-08-28T20:06:35Z")

</div>

I created a pull request here: [Remove unneeded "restricted" Ubuntu repository by leaf-node · Pull Request #405 · discourse/discourse\_docker · GitHub](https://github.com/discourse/discourse_docker/pull/405)

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [4 Febrero, 2020 16:51 UTC](https://meta.discourse.org/t/docker-image-includes-unneeded-ubuntu-restricted-non-free-repo/88931/12 "2020-02-04T16:51:03Z")

</div>


