Compare commits

...

11 Commits

Author SHA1 Message Date
Jeremy Grossmann
483719568f
Merge pull request #2511 from NAKNAO-nnct/feature/update-dockerfile-ubuntu-2404
Some checks failed
CodeQL / Analyze (python) (push) Has been cancelled
testing / build (ubuntu-latest, 3.10) (push) Has been cancelled
testing / build (ubuntu-latest, 3.11) (push) Has been cancelled
testing / build (ubuntu-latest, 3.12) (push) Has been cancelled
testing / build (ubuntu-latest, 3.13) (push) Has been cancelled
testing / build (ubuntu-latest, 3.8) (push) Has been cancelled
testing / build (ubuntu-latest, 3.9) (push) Has been cancelled
Update Dockerfile base image to Ubuntu 24.04
2025-03-08 20:26:12 +07:00
NAKNAO-nnct
018598a300 refactor 2025-03-08 20:22:06 +09:00
NAKNAO-nnct
e262a46cfd rm space 2025-03-08 20:19:37 +09:00
NAKNAO-nnct
00bf1c028b Update README to Run Docker Compose 2025-03-08 14:11:42 +09:00
NAKNAO-nnct
21ebb934f4 add compose.yaml 2025-03-08 14:08:42 +09:00
NAKNAO-nnct
2ecd2cfe3b update Ubuntu24.04 2025-03-08 13:59:05 +09:00
Jeremy Grossmann
ce4b3091dd
Merge pull request #2507 from GNS3/fix-remote-install-script
Some checks failed
CodeQL / Analyze (python) (push) Has been cancelled
testing / build (ubuntu-latest, 3.10) (push) Has been cancelled
testing / build (ubuntu-latest, 3.11) (push) Has been cancelled
testing / build (ubuntu-latest, 3.12) (push) Has been cancelled
testing / build (ubuntu-latest, 3.13) (push) Has been cancelled
testing / build (ubuntu-latest, 3.8) (push) Has been cancelled
testing / build (ubuntu-latest, 3.9) (push) Has been cancelled
Improvements for remote-install.sh
2025-03-03 05:55:42 +07:00
grossmj
f722816849
Improvements for remote-install.sh
* Use apt-add-repository to install repository
* Add option to not upgrade the system
* Check if Python version is >= 3.9 when installing from ppa-v3 repository
2025-03-02 22:27:53 +07:00
Jeremy Grossmann
4cb38b23eb
Merge pull request #2506 from FedericoTorres233/patch-1
Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
testing / build (ubuntu-latest, 3.10) (push) Waiting to run
testing / build (ubuntu-latest, 3.11) (push) Waiting to run
testing / build (ubuntu-latest, 3.12) (push) Waiting to run
testing / build (ubuntu-latest, 3.13) (push) Waiting to run
testing / build (ubuntu-latest, 3.8) (push) Waiting to run
testing / build (ubuntu-latest, 3.9) (push) Waiting to run
Check if remote-install.sh is being run as root
2025-03-02 16:14:33 +08:00
Federico Torres
f3e46227d8
fix: check if remote-install.sh is being run as root 2025-03-01 16:56:21 -03:00
Jeremy Grossmann
185cd01e19
Merge pull request #2488 from GNS3/release/v2.2.53
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Release v2.2.53
2025-01-21 09:47:43 +07:00
4 changed files with 56 additions and 62 deletions

View File

@ -1,24 +1,27 @@
# Dockerfile for GNS3 server development
FROM ubuntu:18.04
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# Set the locale
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
# this environment is externally managed
ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:gns3/ppa
RUN apt-get update && apt-get install -y \
locales \
python3-pip \
python3-dev \
python3-dev \
qemu-system-x86 \
qemu-kvm \
libvirt-bin \
x11vnc
libvirt-daemon-system libvirt-clients \
x11vnc
RUN locale-gen en_US.UTF-8
@ -32,4 +35,4 @@ RUN pip3 install --no-cache-dir -r /server/requirements.txt
EXPOSE 3080
CMD python3 -m gns3server
CMD [ "python3", "-m", "gns3server", "--port", "3080" ]

View File

@ -112,6 +112,12 @@ For development, you can run the GNS3 server in a container
bash scripts/docker_dev_server.sh
```
#### use Docker Compose
``` {.bash}
docker compose up -d
```
### Run as daemon (Unix only)
You will find init sample scripts for various systems inside the init

7
compose.yaml Normal file
View File

@ -0,0 +1,7 @@
services:
gen3-server:
build:
context: .
dockerfile: Dockerfile
ports:
- "8001:3080"

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (C) 2024 GNS3 Technologies Inc.
# Copyright (C) 2025 GNS3 Technologies Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -28,6 +28,7 @@ function help {
echo "--with-i386-repository: Add the i386 repositories required by IOU i386 images. This is not needed for recent x86_64 IOU images." >&2
echo "--with-welcome: Install GNS3-VM welcome.py script" >&2
echo "--without-kvm: Disable KVM, required if system do not support it (limitation in some hypervisors and cloud providers). Warning: only disable KVM if strictly necessary as this will degrade performance" >&2
echo "--without-system-upgrade: Do not upgrade the system" >&2
echo "--unstable: Use the GNS3 unstable repository" >&2
echo "--custom-repository <repository>: Use a custom repository" >&2
echo "--help: This help" >&2
@ -38,6 +39,13 @@ function log {
}
lsb_release -d | grep "LTS" > /dev/null
if [ "$EUID" -ne 0 ]
then
echo "This script must be run as root"
exit 1
fi
if [ $? != 0 ]
then
echo "This script can only be run on a Linux Ubuntu LTS release"
@ -52,6 +60,7 @@ USE_VPN=0
USE_IOU=0
I386_REPO=0
DISABLE_KVM=0
NO_SYSTEM_UPGRADE=0
WELCOME_SETUP=0
TEMP=`getopt -o h --long with-openvpn,with-iou,with-i386-repository,with-welcome,without-kvm,unstable,custom-repository:,help -n 'gns3-remote-install.sh' -- "$@"`
@ -85,6 +94,10 @@ while true ; do
DISABLE_KVM=1
shift
;;
--without-system-upgrade)
NO_SYSTEM_UPGRADE=1
shift
;;
--unstable)
REPOSITORY="unstable"
shift
@ -102,68 +115,33 @@ while true ; do
esac
done
if [ "$REPOSITORY" == "ppa-v3" ]
then
if ! python3 -c 'import sys; assert sys.version_info >= (3,9)' > /dev/null 2>&1; then
echo "GNS3 version >= 3.0 requires Python 3.9 or later"
exit 1
fi
fi
# Exit in case of error
set -e
export DEBIAN_FRONTEND="noninteractive"
UBUNTU_CODENAME=`lsb_release -c -s`
log "Add GNS3 repository"
log "Updating system packages, installing curl and software-properties-common"
apt update
apt install -y curl software-properties-common
if [ ! -f "/etc/apt/sources.list.d/ubuntu.sources" ]
if [ $NO_SYSTEM_UPGRADE == 0 ]
then
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B83AAABFFBD82D21B543C8EA86C22C2EC6A24D7F
cat <<EOFLIST > /etc/apt/sources.list.d/gns3.list
deb http://ppa.launchpad.net/gns3/ppa/ubuntu $UBUNTU_CODENAME main
deb-src http://ppa.launchpad.net/gns3/ppa/ubuntu $UBUNTU_CODENAME main
EOFLIST
else
cat <<EOFLIST > /etc/apt/sources.list.d/gns3-ppa.sources
Types: deb
URIs: https://ppa.launchpadcontent.net/gns3/$REPOSITORY/ubuntu/
Suites: $UBUNTU_CODENAME
Components: main
Signed-By:
-----BEGIN PGP PUBLIC KEY BLOCK-----
.
mQINBGY0jSYBEADMH5CvX8ZVX4XzAxdQ2CmF7t86IjFnQgtI18Q19nVnpKEGNyB5
pgotDMzkhGnxuhvz2zE9PZhd8VgkodB81V607d/Dy8FfI7t1BVQhLvJDx0H/q6RE
n2y9WxiuBzTHitoQTCTY3hjcr7AUNFFI64gUqwbkQmYbCWWsYOlDpRSkWKg8P8WK
08RetwTI0Iwoz8j+BkbPlubuImiVfh1TeH23FBuGIwL1r1Cps0wel6JAi+jaU9WG
j8MX3mQYFTAtk7f1lRubqWosB/A4xIu609pF1e1tAkWAGltYAeoFhDn+PfA9KgmV
fvxfVR7zmxp31imTJgXgUFCz+H0Xb3vpve8XsrsHZUP6StJ3+6cFXjNBV6PuO1FT
JWp86a+AYHg7+sUWcoJRZPCTbb/pOcCa0q1ch5qcLkiYEOGK+pYhbPptq6y8IsJW
N6EDNCVvVqVyTJy14FZWoOqxcpUiDOQ+su28j8++V+PMo+FO3SQqwEZwJXk7LF/4
wUipDCUh/WNjDqqgmYLoO+ttiiJPbEw3jtbO+zopbzY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" -o Dpkg::Options::="--force-confold"
fi
log "Updating system packages and installing curl"
apt update
apt install -y curl
log "Upgrading packages"
apt upgrade --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
log "Adding GNS3 repository ppa:gns3/$REPOSITORY"
# use sudo -E to preserve proxy config
sudo -E apt-add-repository -y "ppa:gns3/$REPOSITORY"
log "Installing the GNS3 server and its dependencies"
apt install -y gns3-server