Dear Community User! We are updating our platform to a new system.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

docker image cannot be snaped

docker image cannot be snaped

Open
Occasional Contributor

Hi @Sgilk ,

I am new to Docker,

I am trying to follow the video example, but i had trouble snapping the app.

I am using ctrlX works App Build Environments and vscode to established a SSH connection.

I run below command:

1) Git clone https://github.com/S-Gilk/ctrlx-docker-mosquitto-interface

2) sudo apt install docker

Now i will need to configure buildx

How to configure buildx? 

When i tried to run build task, it is not recognised in the build task terminal.

Open_0-1697087698405.png

warmest regards,

9 REPLIES 9

MauroRiboniMX
Contributor

Hello, 

You have to install docker as a snap. i try to give you some examples. 

Sgilk
Frequent Contributor

First install Docker.

(snap install docker)

Then, follow the Docker BuildX install instructions here and you should be able to run the build. Make sure you pass your architecture to the build command. ie. (./scripts/build_all.sh "arm64")

Docker BuildX Install Instructions 

Open
Occasional Contributor

I managed to snap the file, however when i installed the snap file into the ctrlX, there are some errors with the ui and interface.

I have Px.exe running on my PC background.

When i install the snap file into the ctrlX, the container engine does not show the MQTT broker 

2023-10-13_09h54_38.png

2023-10-13_09h54_43.png

When i run the command below:

 

boschrexroth@app-builder-amd64:~/ctrlx-docker-mosquitto-interface$ sudo ./scripts/build_all.sh "arm64"
--- clean up Docker
Error response from daemon: No such container: ui
Error response from daemon: No such container: interface
Total reclaimed space: 0B
Error response from daemon: No such image: interface:latest
Error response from daemon: No such image: ui:latest
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.

Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
TARGET_ARCH: arm64
--- build mosquitto
TARGET_ARCH: arm64
--- create ../docker-compose/docker-compose.env
removed '../docker-compose/docker-compose.env'
--- create docker image with platform arm64
Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: no such host
Error response from daemon: reference does not exist
Error: No such image: eclipse-mosquitto:latest
--- build datalayer interface
TARGET_ARCH: arm64
--- add image env variables
--- create ctrlx-datalayer-mqtt-interface docker image with platform arm64
[+] Building 0.2s (4/4) FINISHED                                                                                                                         
 => [internal] load build definition from Dockerfile_interface                                                                                      0.1s
 => => transferring dockerfile: 851B                                                                                                                0.0s
 => [internal] load .dockerignore                                                                                                                   0.0s
 => => transferring context: 2B                                                                                                                     0.0s
 => ERROR [internal] load metadata for docker.io/library/ubuntu:20.04                                                                               0.0s
 => CANCELED [context project] load .dockerignore                                                                                                   0.1s
 => => transferring project:                                                                                                                        0.1s
------
 > [internal] load metadata for docker.io/library/ubuntu:20.04:
------
Dockerfile_interface:2
--------------------
   1 |     # Specify the parent image from which we build
   2 | >>> FROM ubuntu:20.04
   3 |     
   4 |     # Set the working directory
--------------------
ERROR: failed to solve: ubuntu:20.04: failed to do request: Head "https://registry-1.docker.io/v2/library/ubuntu/manifests/20.04": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: no such host
Error response from daemon: reference does not exist
Error: No such image: ctrlx-datalayer-mqtt-interface:latest
--- build datalayer interface ui
TARGET_ARCH: arm64
--- add image env variables
--- create ctrlx-datalayer-mqtt-ui docker image with platform arm64
[+] Building 0.2s (4/4) FINISHED                                                                                                                         
 => [internal] load build definition from Dockerfile_ui                                                                                             0.0s
 => => transferring dockerfile: 599B                                                                                                                0.0s
 => [internal] load .dockerignore                                                                                                                   0.0s
 => => transferring context: 2B                                                                                                                     0.0s
 => ERROR [internal] load metadata for docker.io/library/python:3.12-rc-slim-buster                                                                 0.0s
 => CANCELED [context project] load .dockerignore                                                                                                   0.1s
 => => transferring project:                                                                                                                        0.1s
------
 > [internal] load metadata for docker.io/library/python:3.12-rc-slim-buster:
------
Dockerfile_ui:2
--------------------
   1 |     # Specify the parent image from which we build
   2 | >>> FROM python:3.12-rc-slim-buster
   3 |     
   4 |     # Set the working directory
--------------------
ERROR: failed to solve: python:3.12-rc-slim-buster: failed to do request: Head "https://registry-1.docker.io/v2/library/python/manifests/3.12-rc-slim-buster": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: no such host
Error response from daemon: reference does not exist
Error: No such image: ctrlx-datalayer-mqtt-ui:latest
--- build snap
TARGET_ARCH: arm64
--- clean snap
Running with 'sudo' may cause permission errors and is discouraged. Use 'sudo' when cleaning.
--- build snap with architecture arm64
Running with 'sudo' may cause permission errors and is discouraged. Use 'sudo' when cleaning.
*EXPERIMENTAL* --target-arch for core20 enabled.
Setting target machine to 'arm64'
Pulling docker-compose 
+ snapcraftctl pull
Building docker-compose 
+ snapcraftctl build
+ cp --archive --link --no-dereference . /home/boschrexroth/ctrlx-docker-mosquitto-interface/parts/docker-compose/install
Staging docker-compose 
+ snapcraftctl stage
Priming docker-compose 
+ snapcraftctl prime
Snapping |                                                                                                                                    
Snapped ctrlx-docker-mosquitto-interface_1.1_arm64.snap
--- clean snap
Running with 'sudo' may cause permission errors and is discouraged. Use 'sudo' when cleaning.
Cleaning up priming area
Cleaning up staging area
Cleaning up parts directory

 

Open_1-1697165478593.png

Did i missed out anything?

CodeShepherd
Community Moderator
Community Moderator

Moved to corresponding sub forum SDK from this topic.

 

Hello,

Try this and give me a feedback.

Mauro

Sgilk
Frequent Contributor

There are a number of errors here that indicate an internet connection problem. You are failing to pull the parent images when building from Dockerfile. I don't know your exact networking details, but make sure you have internet access and your proxy is configured correctly. If you can't (wget google.com), you won't be able to build.

Open
Occasional Contributor

After i installed BuildX, i tried running the command below:

Open_1-1697600165758.png

It is not able to find the image. 

Open_0-1697600111618.png

Did i missed out something? 

Sgilk
Frequent Contributor

Again, this looks like an internet connection issue. There are many possibilities of what could be causing the problem, so I can't provide a specific fix in this case. I'd suggest trying this on a personal PC and home network if you are currently on a company PC and VPN. 

Can you (wget google.com) from a bash terminal in your development environment?

Are you on a VPN or using a proxy?

Open
Occasional Contributor

Thank you @MauroRiboniMX for helping!

I did not run docker as normal user

enter the command line below line by line: Source

 

 sudo addgroup --system docker
 sudo adduser $USER docker
 newgrp docker
 sudo snap disable docker
 sudo snap enable docker

 

Also before executing ./build_all.sh enter this command line "sudo chmod 777 -R *” to enable every user has the rights to not only access this folder, but also read, write and execute it's files.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist