顯示具有 docker 標籤的文章。 顯示所有文章
顯示具有 docker 標籤的文章。 顯示所有文章

2025年7月19日 星期六

Install GVM Vulnerability Scanner on Ubuntu 24.04 Using Containers

 在 Ubuntu 下使用 Docker 安裝 OpenVAS 

參考來源:  https://medium.com/@ma7moudsabra/install-gvm-vulnerability-scanner-on-ubuntu-24-04-using-containers-fd38935b7121

 

  1. Set up Docker’s apt repository.
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable"
| \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

 如果是使用 Linux Mint 22.1 的環境,上面的 $VERSION_CODENAME 這裡會不正確,手動改為 noble 就可以了。 

 

2. Install the Docker and dependencies packages.

sudo apt-get install gnupg docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

3. Verify that the installation is successful by running the hello-world image:

sudo docker run hello-world

 

 

4. Manage Docker as a non-root user

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

5. Verify that you can run docker commands without sudo.

docker run hello-world

6. For downloading the Greenbone Community Edition docker compose file, a destination directory should be created.

export DOWNLOAD_DIR=$HOME/greenbone-community-container && mkdir -p $DOWNLOAD_DIR

7. Download the file

cd $DOWNLOAD_DIR && curl -f -L https://greenbone.github.io/docs/latest/_static/docker-compose-22.4.yml -o docker-compose.yml

 

 

8. To allow remote access to the Greenbone Web Interface, you need to modify the docker compose file to configure the web server (gsad) to listen on all network interfaces.

  gsa:
image: greenbone/gsa:stable
restart: on-failure
ports:
- 127.0.0.1:9392:80 #before
volumes:
- gvmd_socket_vol:/run/gvmd
depends_on:
- gvmd
----
gsa:
image: greenbone/gsa:stable
restart: on-failure
ports:
- 9392:80 #After
volumes:
- gvmd_socket_vol:/run/gvmd
depends_on:
- gvmd

9. Start the Greenbone Community Edition container.

docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition up -d

Accessing OpenVAS

OpenVAS is now installed and running on your Ubuntu 24.04 LTS system. To access the OpenVAS web interface:

1. Open a web browser and navigate to http://localhost:9392.

2. Log in using the default credentials:

  • Username: admin
  • Password: admin

 

 

 

 

 

 

 

 

2017年11月8日 星期三

Stop / remove / delete all Docker containers


ref source:
https://coderwall.com/p/ewk0mq/stop-remove-all-docker-containers
https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes

若要停止、移除、刪掉 Docker images 檔案,可以用以下方式處理:
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker ps -a -q) 
 
 

How To install Docker in Linux Mint 18.2


source: http://budthapa.pro/blog/show/6/How-To-install-Docker-in-Linux-Mint-18.2



Docker for Linux Mint is availabe as a free Community Edition (CE). Installation is easy and straigh forward. We will install a stable release of docker.
OS Requirements
  • Linux Mint 18.2 (LTS)
  • Architecture: x86_64
If you've the older version installed already, uninstall it
$ sudo apt-get remove docker docker-engine docker.io
Add repositories
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Since, Linux Mint 18.2 (sonya) is based on Ubuntu 16.04 (xenial), we've to use the release codename of Ubuntu 16.04 i.e. xenial. Also, we'll use the latest stable version
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
If you are using Linux Mint 16 (petra), you've to use the release codename "trusty"
To check the release codename of you Linux Mint pc, In your terminal type:
lsb_release -rc
You'll see the release and codename printed in the terminal as
Release: 18.2
Codename: sonya
Now, update the pc
$ sudo apt update

Finally, we'll Install docker community version (CE) in Linux mint 18.2

$ sudo apt install docker-ce
Check if the docker is properly installed by typing
$ docker version
You'll get the output like this:
Client:
 Version:      17.06.2-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 20:00:17 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.06.2-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 19:59:11 2017
 OS/Arch:      linux/amd64
 Experimental: false
 Running hello world in docker is easy, Just run
$ sudo docker run hello-world
You must be root user to use docker

Running docker command as non root user

If you are a single user and don't want to enter your password everytime while executing docker command, you have to add the current user in docker group.
$ sudo groupadd docker #this is most likely already created while installing docker
$ sudo gpasswd -a $USER docker
$ newgrp docker # you might need to logout if the changes are not working
$ docker run hello-world # check if docker is working without sudo