crops / extsdk-container

A container image that is able to setup and use an extensible sdk generated using openembedded-core.
GNU General Public License v2.0
36 stars 15 forks source link

Update apt-get in Dockerfile #12

Closed Ricardicus closed 2 years ago

Ricardicus commented 3 years ago

I failed to build the Docker image so I added a fix and thought that perhaps it would be relevant to include it upstream. The error I got was the following:

 => ERROR [4/4] RUN userdel -r yoctouser &&     groupadd -g 70 usersetup &&     useradd -N -m -u 70 -g 70 usersetup &&     apt-get -y install curl sudo &&     echo "#include /etc/sudoers.usersetup" >> /etc/sudoers &&     ch  1.8s
------
 > [4/4] RUN userdel -r yoctouser &&     groupadd -g 70 usersetup &&     useradd -N -m -u 70 -g 70 usersetup &&     apt-get -y install curl sudo &&     echo "#include /etc/sudoers.usersetup" >> /etc/sudoers &&     chmod 755 /usr/bin/usersetup.py         /usr/bin/esdk-launch.py         /usr/bin/esdk-entry.py         /usr/bin/restrict_groupadd.sh         /usr/bin/restrict_useradd.sh:
#6 0.278 userdel: yoctouser mail spool (/var/mail/yoctouser) not found
#6 0.374 Reading package lists...
#6 1.186 Building dependency tree...
#6 1.317 Reading state information...
#6 1.429 sudo is already the newest version (1.8.16-0ubuntu1.9).
#6 1.429 The following packages were automatically installed and are no longer required:
#6 1.430   libexpat1-dev libpython3-dev libpython3.5 libpython3.5-dev python-pip-whl
#6 1.430   python3-dev python3-pkg-resources python3-setuptools python3-wheel
#6 1.430   python3.5-dev
#6 1.430 Use 'apt autoremove' to remove them.
#6 1.432 The following NEW packages will be installed:
#6 1.433   curl
#6 1.531 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
#6 1.531 Need to get 139 kB of archives.
#6 1.531 After this operation, 340 kB of additional disk space will be used.
#6 1.531 Err:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 curl amd64 7.47.0-1ubuntu2.16
#6 1.531   404  Not Found [IP: 91.189.88.142 80]
#6 1.732 Err:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 curl amd64 7.47.0-1ubuntu2.16
#6 1.732   404  Not Found [IP: 91.189.88.142 80]
#6 1.734 E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.47.0-1ubuntu2.16_amd64.deb  404  Not Found [IP: 91.189.88.142 80]
#6 1.734
#6 1.734 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
------
executor failed running [/bin/sh -c userdel -r yoctouser &&     groupadd -g 70 usersetup &&     useradd -N -m -u 70 -g 70 usersetup &&     apt-get -y install curl sudo &&     echo "#include /etc/sudoers.usersetup" >> /etc/sudoers &&     chmod 755 /usr/bin/usersetup.py         /usr/bin/esdk-launch.py         /usr/bin/esdk-entry.py         /usr/bin/restrict_groupadd.sh         /usr/bin/restrict_useradd.sh]: exit code: 100
rewitt1 commented 3 years ago

Hi @Ricardicus,

Thanks for this, but I believe this is happening due to the base image at crops/yocto-dockerfiles not getting updated. This is because travis-ci has started limiting the number of compute cycles available, even for open source projects. In other words, the apt update shouldn't be needed since the base image normally gets updated once a week. https://github.com/crops/yocto-dockerfiles/blob/master/dockerfiles/ubuntu/ubuntu-20.04/ubuntu-20.04-base/Dockerfile#L19

As of now my plan is to move everything over to Github Actions and hopefully the once a week builds will be allowed.

I'm going to hold off on merging this until I get everything moved over and make sure it's not necessary. Sorry I took so long to respond, I do appreciate the pull request.

Ricardicus commented 3 years ago

No worries! I understand; but without this PR, there is a risk that a build still fails 6 days in a row if I understand you correctly. Not including this PR makes the build time shorter I presume, as the update process takes a while so I understand the hesitation from that point of view.

rewitt1 commented 3 years ago

but without this PR, there is a risk that a build still fails 6 days in a row if I understand you correctly.

You are correct. But I'm not concerned with the build time as much as I am the image size. The image is already quite large, especially relative to the typical image, so I want to make sure I understand what the size change would be and how to reduce it if possible.

Ricardicus commented 3 years ago

Ok. Yes it is large. I hope it will be a negligle impact. Also; speaking of size, I wonder the image size shrinks, and still works, if "--no-install-recommends" is passed to apt-get install.

rewitt1 commented 3 years ago

Also; speaking of size, I wonder the image size shrinks, and still works, if "--no-install-recommends" is passed to apt-get install.

It might. But even if it has a noticeable impact on the size, the concern I would have is any expected behavior that people may have based on the recommends getting installed. And the only way we would find out if those exist would be to change it and wait for the unhappy people.

moto-timo commented 2 years ago

NOTE: The extsdk-container is rebuilt every week, so it should pick up the latest upstream ubuntu-18.04 container. https://hub.docker.com/r/crops/extsdk-container/tags