Two days back I formatted my PC and had to re installed Ubuntu. After ensuring Ubuntu was up to date I had to install Docker . Thought I might as well document the steps as a number of our users have asked about this on the forum. I also thought of taking some screenshots in case it helps.
Step 1. Setting up the build environment
In short you need a lot of ROM and hard disk space. It will be easier for me to show the specs of my PC
As you can see it is an i5 ( 5 yrs old). I have a 1 Tb hdd ( almost empty at present) + 16 GB RAM.
Keep aside at least 200 GB of build space
Step 2 : On your PC you need Docker to be running normally
I followed the instructions given at the Docker website and specifically on the Ubuntu page … https://docs.docker.com/install/linux/docker-ce/ubuntu/
I have added the instructions I ran to install Docker from their website and give them here. I copy paste the commands to save time and not make mistakes.
Setting up the ubuntu repository
a. Update the apt package index:
$ sudo apt-get update
b. Install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get install
c. Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.
$ sudo apt-key fingerprint 0EBFCD88
running this command will display something like this
pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [ unknown] Docker Release (CE deb) <firstname.lastname@example.org> sub rsa4096 2017-02-22 [S]
d. Use the following command to set up the stable repository ( I choose the option for x86_64/amd64 the first option )
$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
e. Install Docker CE
a. Update the apt package index.
$ sudo apt-get update
b. Install the latest version of Docker CE and container:
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
f. Verify that Docker CE is installed correctly by running the hello-world image.
$ sudo docker run hello-world This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
g. At this point if you get an error of access denied it maybe because your user does not have access to run Docker
A sample of the error that appears on the screen - missed getting a screenshot . so copied the error from the net :) docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied. To resolve this i ran this command sudo usermod -a -G docker $USER
Step 3 . Getting the latest docker image for /e/ . You will run this command as given on wiki . Please note every time you run a build it is a good idea to run this command to ensure you have the latest image on your PC. A mismatch between this image and the one on the server can cause interesting errors in your build Also the build command does not pull down the latest in case you are looking at the last line of the command)
sudo docker pull registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:latest
Step 4. Once this step is complete create the folder structure required for the build. I created a folder under my home / username / e check the screenshot below. You can see a folder named e there.
Step 5. Inside this e folder create sub folders . You can do this all with console command but I am from the world of Windows GUI and like to take the easy way out. It is also easier to explain Do not make any spelling mistakes …for example cache instead of ccache can create build issues. Docker is very particular that way
Step 6. Now you can start the syncing of the e source code
Run the command in a console as described in the wiki …
There are two changes you need to make . One is the device name of the device you want to build and the second is the branch name. Oreo or nougat/
Now your console will look like this
This phase will take a lot of time. It all depends on your internet speed. For me it took 6 hours and that was fast. I have had this screen for a full day as well. The build process pulls down all the source code for building /e/ . It could be more than a 100GB of files in the end so it will take time.
Step 7. The build starts.
When the build starts the screen looks like this
Again at this point the screen will appear stuck. This is because Docker does not want to trouble you with the nitty-gritty of the heavy work that is happening behind the back. You can check this out by having a look at the log files. There will be two log files inside the log folder. The file named repoxxx has the details of what has been pulled down from the various servers. There will be a folder created inside the log folder with the name of the device you are building for. Inside there will be a log giving details of the build as it progresses. The build process will be writing to this file so try not to keep it open to examine. You can take a copy aside to examine.
Step 8. The build finished successfully.
When the build finishes successfully the screen looks like this.
Here you will notice the last three lines mention about what happened to the build. In this case it was successful. You will now find the build in the zip folder.
In case the build fails the message will mention that. Build failed but still clean up the OUT folders ( the folder in which the build is cooked).
The purpose of this post is to share the snapshots of the screen while the build is running just in case you are attempting a build and wondering what Docker is up to. I learnt this the hard way and may have missed a step. Feel free to let me know in there are errors in this post.
Please note : This method work perfectly for Lineage supported devices only.