I am trying to install buildx from docker doc. At first, I tried Install using a Dckerfile. I have to say, I have no clue how to install it with this steps, the instructions is very poor for this section. So I pick option Download manually.
I downloaded buildx-v0.10.2.darwin-amd64 binary, copy it to $HOME/.docker/cli-plugins and rename it as docker-buildx and make it executable:
$ ll $HOME/.docker/cli-plugins/docker-buildx
-rwxr-xr-x 1 root root 55984928 Feb 14 20:05 /root/.docker/cli-plugins/docker-buildx*
All this steps are from documentation.
As next step, I wanted to Set Buildx as the default builder. According to the docs, I shuld run docker buildx install but it raised and exception 'buildx' is not a docker command:
$ docker buildx install
docker: 'buildx' is not a docker command.
See 'docker --help'
The instructions are very unclear to me and dont know how to fix it. I found this but its basically the same steps so its do not help.
Can anybody help me to find out, whats I am missing?
$ uname -m
x86_64
Docker version 23.0.1, build a5ee5b1
first execute
~/.docker/cli-plugins/docker-buildx
and see if you can execute it.
if it is not executable then docker buildx install will fail
Related
i've been using a docker container to build the chromium browser (building for Android on Debian 10). I've already created a Dockerfile that contains most of the packages I need.
Now, after building and running the container, I followed the instructions, which asked me to execute an install script (./build/install-build-deps-android.sh). In this script multiple apt install commands are executed.
My question now is, is there a way to install these packages without rebuilding the container? Downloading and building it took rather long, plus rebuilding a container each time a new package is required seems kind of suboptimal. The error I get when executing the install script is:
./build/install-build-deps-android.sh: line 21: lsb_release: command not found
(I guess there will be multiple missing packages). And using apt will give:
root#677e294147dd:/android-build/chromium/src# apt install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nginx
(nginx just as an example install).
I'm thankfull for any hints, as I could only find guides that use the Dockerfile to install packages.
You can use docker commit:
Start your container sudo docker run IMAGE_NAME
Access your container using bash: sudo docker exec -it CONTAINER_ID bash
Install whatever you need inside the container
Exit container's bash
Commit your changes: sudo docker commit CONTAINER_ID NEW_IMAGE_NAME
If you run now docker images, you will see NEW_IMAGE_NAME listed under your local images.
Next time, when starting the docker container, use the new docker image you just created:
sudo docker run **NEW_IMAGE_NAME** - this one will include your additional installations.
Answer based on the following tutorial: How to commit changes to docker image
Thanks for #adnanmuttaleb and #David Maze (unfortunately, they only replied, so I cannot accept their answers).
What I did was to edit the Dockerfile for any later updates (which already happened), and use the exec command to install the needed dependencies from outside the container. Also remember to
apt update
otherwise you cannot find anything...
A slight variation of the steps suggested by Arye that worked better for me:
Create container from image and access in interactive mode: docker run -it IMAGE_NAME bin/bash
Modify container as desired
Leave container: exit
List launched containers: docker ps -a and copy the ID of the container just modified
Save to a new image: docker commit CONTAINER_ID NEW_IMAGE_NAME
If you haven't followed the Post-installation steps for Linux
, you might have to prefix Docker commands with sudo.
When I execute the command ./byfn.sh -m up
The following error occurs:
Starting with channel 'mychannel' and CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
docker: Cannot connect to the Docker daemon at tcp://127.0.0.1:4243. Is the docker daemon running?.
See 'docker run --help'.
LOCAL_VERSION=1.1.0-rc1
DOCKER_IMAGE_VERSION=
=================== WARNING ===================
Local fabric binaries and docker images are
out of sync. This may cause problems.
===============================================
ERROR: Couldn't connect to Docker daemon. You might need to start Docker for Mac.
ERROR !!!! Unable to start network
Fetch bootstrap.sh from fabric repository using
curl -sS https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh -o ./scripts/bootstrap.sh
Change file mode to executable
chmod +x ./scripts/bootstrap.sh
Download binaries and docker images
./scripts/bootstrap.sh [version]
You have to re-sync the docker images first:
fabric-samples/scripts$ sudo ./fabric-preload.sh
Make sure you have the right version set in the script. In your case VERSION=1.1.0-rc1
you have to give the permission, try
sudo ./byfn.sh -m up
This message caused from your Docker Daemon since it not started yet, please start your docker first.
You are trying to use diiferent versions of the Fabric and the Docker images.
you can update the yum and docker's version,use:yum update,and url of docker:https://docs.docker.com/install/linux/docker-ce/centos/
I have a setup where docker ONLY works as root (I know, my fault). I'm trying to follow the GCR quickstart: [1]. I can't find anything on the troubleshooting page [2] either.
Can you help me (and I can then file a document fix)?
[1] https://cloud.google.com/container-registry/docs/quickstart
[2] https://cloud.google.com/container-registry/docs/support/troubleshooting
Repro
Reproduction steps (also in b/68796816):
$ docker -v
Docker version 1.6.2, build 7c8fca2
ricc#rubino:~/git/gce-recipes/gke/quickstart-image$ sudo docker run busybox date
Thu Nov 2 12:29:35 UTC 2017
$ sudo docker tag quickstart-image gcr.io/ric-cccwiki/quickstart-image
# All good so far ...
Option 1 (no sudo):
# no sudo: docker doesn't work
$ gcloud docker -- push gcr.io/ric-cccwiki/quickstart-image
FATA[0000] Post http:///var/run/docker.sock/v1.18/images/gcr.io/ric-cccwiki/quickstart-image/push?tag=: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
Option 2: with sudo:
# docker works but gcloud is not found
$ sudo gcloud docker -- push gcr.io/ric-cccwiki/quickstart-image
sudo: gcloud: command not found
Neither way works
There are a few options, the best being to just make docker usable without root: https://docs.docker.com/engine/installation/linux/linux-postinstall/
Option 1: Specify your full path to gcloud when using it.
sudo $(which gcloud)
Option 2: Install glcoud as root
sudo su
#install gcloud
gcloud version
However, the best thing to do is to just use docker as non-root :)
Jake suggests: gcloud docker is on the deprecation path, for this reason among others.
I'd recommend doing gcloud components install docker-credential-gcr
followed by which docker-credential-gcr, cping the binary to a location
on root's PATH.
sudo docker-credential-gcr configure-docker followed by
sudo docker-credential-gcr gcr-login should then allow you to use sudo
docker without issue.
See credentials helper's docs:
https://github.com/GoogleCloudPlatform/docker-credential-gcr
I'm attempting to set up intrigue on linux mint, and to set up the development environment I'm using docker. I was able to successfully install it
sudo apt-get install docker.io
Currently I'm following a guide which is supposed to describe how to do all of this. Unfortunately it doesn't seem to match up. Here are the commands the guide is having me run:
git clone https://github.com/intrigueio/intrigue-core
cd intrigue-core
docker build .
docker run -i -t -p 7777:7777
Then it says that postgresql, redis, and intrigue-io should all start. It works up to the very last command. After building, I try to run and get this error:
"docker run" requires at least 1 argument(s).
It's not as if the guide is complicated to follow, so I'm just wondering if there is something I'm missing. Is the guide downright incorrect?
You would need to write at least the name of what service you want to run.
But I see they define a docker-compose file, so it might be even easier if you just install it and then run docker-compose up (you can add a -d in the end to make it run as a deamon)
I download the docker and want to compile it from the source code:
[root#localhost docker-1.5.0]# make
mkdir bundles
docker build -t "docker" .
/bin/sh: docker: command not found
make: *** [build] Error 127
Per my understanding, if I want to compile docker, I need to get a docker firstly. Is it right? If it is true, how does the first docker come?
yum or apt-get install docker-io will install the docker-io
then you build it from source and it replace the existing docker or set your path to point to the new docker.
You must have Docker to build Docker only because that's what the Docker guys thought would be the most convenient.
Of course, there is a way to compile the Docker source without having Docker installed on your machine; but then - you will have to have on your machine all the compilation tools and dependencies needed for the compilation.
So, the Docker team "dockerized" the compilation process. Namely, they used Docker itself, and what it is intended to do, also for the compilation of the Docker source.