반응형
1. Uninstall old version
$ sudo apt-get remove docker docker-engine docker.io containerd runc

2. Update the apt package index and install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get update
$ sudo apt-get install \
 apt-transport-https \
 ca-certificates \
 curl \
 gnupg-agent \
 software-properties-common

3. Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

4. 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

pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]

5. Use the following command to set up the stable repository. 

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

6.
 $ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

7. Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:
 $ sudo apt-get update
 $ sudo apt-get install docker-ce docker-ce-cli containerd.io

8. To install a specific version of Docker Engine, list the available versions in the repo, then select and install:
a. List the versions available in your repo:
$ apt-cache madison docker-ce

  docker-ce | 5:18.09.1~3-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu  xenial/stable amd64 Packages
  docker-ce | 5:18.09.0~3-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu  xenial/stable amd64 Packages
  docker-ce | 18.06.1~ce~3-0~ubuntu       | https://download.docker.com/linux/ubuntu  xenial/stable amd64 Packages
  docker-ce | 18.06.0~ce~3-0~ubuntu       | https://download.docker.com/linux/ubuntu  xenial/stable amd64 Packages
  ...


9.
$ docker search yocto
NAME                                        DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
crops/yocto                                 Images for building with the Yocto project.     21                                      
coldnew/yocto-build                         Building environment for Yocto project.         3                                       [OK]
vaddio/yocto                                Yocto build container for VNG                   2                                       [OK]
resin/yocto-build-env                                                                       2                                       
vaddio/yocto-16.04                          Yocto build container for Ubuntu 16.04          1                                       [OK]
starlabio/yocto                             image we can use to build Yocto                 1                                       [OK]
reliableembeddedsystems/yocto-autobuilder   yocto-autobuilder in a container                1                                       [OK]
felixb/yocto-httpd                          yhttp serves 200 responses to any GET reques…   1                                       
derekstraka/yocto                           Docker environment to build yocto elements      0                                       [OK]
dkomljenovic2502/yoctobuild                 Default Yocto build                             0                                       
privkweihmann/yocto-sca-minimal             Minimal yocto container to build with meta-s…   0                                       
cardoe/yocto                                build environment for Yocto                     0                                       [OK]
openembedded/yocto                          Yocto Project Core Multiarch Minimal Docker …   0                                       
scypho/yocto-sdk                            This image contains the SDK for our yocto OS    0                                       
minotaurinc/yocto                           Yocto build container                           0                                       [OK]
anyakichi/yocto-rpi-builder                                                                 0                                       
saspl/yoctoamd64dev                         Image generated from yocto                      0                                       
vicamo/yocto                                Dockerfile for Yocto development.               0                                       [OK]
kz8s/yocto                                  yocto build image                               0                                       [OK]
3mdeb/yocto-docker                          Containerized build environment for Yocto Pr…   0                                       
nimitz/yocto-runner                                                                         0                                       
witekio/yocto                               Dockerfile allowing to build distribution us…   0                                       
anyakichi/yocto-builder                                                                     0                                       
yoctotrainer/app-container-redis-oci                                                        0                                       
corfr/yocto-dev                                                                             0                                       [OK]


$ docker pull crops/yocto
Using default tag: latest
Error response from daemon: manifest for crops/yocto:latest not found: manifest unknown: manifest unknown

태그가 잘못되었음.

https://hub.docker.com/r/crops/yocto/tags
들어가서 보면 태그가 나옴

다운로드
$ docker pull crops/yocto:ubuntu-18.04-builder
ubuntu-18.04-builder: Pulling from crops/yocto
a1125296b23d: Pull complete 
3c742a4a0f38: Pull complete 
4c5ea3b32996: Pull complete 
1b4be91ead68: Pull complete 
6a95a06e545e: Pull complete 
dcecfae51fb3: Pull complete 
e7480d99873e: Pull complete 
274fb229853b: Pull complete 
108afa4cb3de: Pull complete 
Digest: sha256:88dadd0981d066c001fcb2a83fc8c3f9b72a3e975a164950a5f82c95a84656a0
Status: Downloaded newer image for crops/yocto:ubuntu-18.04-builder
docker.io/crops/yocto:ubuntu-18.04-builder

도커 이미지 리스트 확인
$ docker images
REPOSITORY          TAG                    IMAGE ID            CREATED             SIZE
crops/yocto         ubuntu-18.04-builder   d8f079d2a3a0        19 hours ago        850MB
km1000              0.1                    7d76c48fdf79        5 weeks ago         995MB
ubuntu              16.04                  005d2078bdfa        2 months ago        125MB

컨테이너 실행하기
$ docker run --name lionel-yocto-build -it -v $(pwd):/yocto crops/yocto:ubuntu-18.04-builder

했는데 안되네. 어떻게 쓰는건지 모르겠다.











다른 방법으로 다시 도전.
이번엔 이미지를 만들어서 해보자

$ cat dockerfile_bionic 
#
# Docker Bionic image to build Yocto 3.0
#
FROM ubuntu:18.04

# Keep the dependency list as short as reasonable
RUN apt-get update && \
    apt-get install -y bc bison bsdmainutils build-essential curl locales \
        flex g++-multilib gcc-multilib git gnupg gperf lib32ncurses5-dev \
        lib32z1-dev libncurses5-dev git-lfs \
        libsdl1.2-dev libxml2-utils lzop \
        openjdk-8-jdk lzop wget git-core unzip \
        genisoimage sudo socat xterm gawk cpio texinfo \
        gettext vim diffstat chrpath \
        libssl-dev \
        python-mako libusb-1.0-0-dev exuberant-ctags \
        pngcrush schedtool xsltproc zip zlib1g-dev libswitch-perl && \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ADD https://commondatastorage.googleapis.com/git-repo-downloads/repo /usr/local/bin/
RUN chmod 755 /usr/local/bin/*

# ===== create user/setup environment =====
# Replace 1000 with your user/group id
RUN export uid=1000 gid=1000 user=lionelj && \
    mkdir -p /home/${user} && \
    echo "${user}:x:${uid}:${gid}:${user},,,:/home/${user}:/bin/bash" >> /etc/passwd && \
    echo "${user}:x:${uid}:" >> /etc/group && \
    echo "${user} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${user} && \
    chmod 0440 /etc/sudoers.d/${user} && \
    chown ${uid}:${gid} -R /home/${user}

# The persistent data will be in these two directories, everything else is
# considered to be ephemeral
#VOLUME ["/tmp/ccache", "/aosp"]

# Improve rebuild performance by enabling compiler cache
ENV USE_CCACHE 1
ENV CCACHE_DIR /home/lionelj/.ccache

# some QT-Apps/Gazebo do not show controls without this
ENV QT_X11_NO_MITSHM 1

# Set the locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8

ENV HOME /home/lionelj
ENV USER lionelj
USER lionelj
#WORKDIR /home/lionelj

이렇게 만들어 놓는다.

wget http://linode.boundarydevices.com/docker/dockerfile_bionic
sed -i "s/jenkins/$USER/" dockerfile_bionic
docker build --file dockerfile_bionic --tag ubuntu_bionic .


docker run -v <host directory>:<container directory> -it ubuntu_bionic

실행.

$ docker run --name lionel-yocto-build -it -v /home/lionelj/dev/mini-N/200707:/200707 -v /pkg:/pkg -v /prj:/prj -v /home/lionelj/dev/yocto/yocto_downloads:/yocto_downloads ubuntu_bionic:latest


다음에 다시 붙을 때

$ docker ps -a
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                   PORTS               NAMES
4746d24cffab        ubuntu_bionic:latest   "/bin/bash"              12 hours ago        Exited (0) 7 hours ago                       lionel-yocto-build
df057a4e7c81        km1000:0.1             "/root/docker_entryp…"   5 weeks ago         Exited (0) 5 weeks ago                       lionel-uluck-aosp

$ docker start lionel-yocto-build
lionel-yocto-build

$ docker attach lionel-yocto-build 
lionelj@4746d24cffab:/$ 
반응형
Posted by Real_G