Last active
March 16, 2020 06:44
-
-
Save sapslaj/ad07f37a5b8f12213dfe2931788864e5 to your computer and use it in GitHub Desktop.
Cisco Packet Tracer 7 Inside a Docker Container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:14.04 | |
| # Replace 1000 with your user / group id | |
| RUN export uid=1000 gid=1000 && \ | |
| mkdir -p /home/pt && \ | |
| echo "pt:x:${uid}:${gid}:PacketTracer:/home/pt:/bin/bash" >> /etc/passwd && \ | |
| echo "pt:x:${uid}:" >> /etc/group && \ | |
| echo "pt ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/pt && \ | |
| chmod 0440 /etc/sudoers.d/pt && \ | |
| chown ${uid}:${gid} -R /home/pt | |
| RUN apt-get update -y | |
| RUN apt-get install -y \ | |
| libqt4-gui \ | |
| libqt4-webkit | |
| ADD PacketTracer70 /opt/pt | |
| USER pt | |
| ENV HOME /home/pt | |
| ENV PTDIR /opt/pt | |
| CMD LD_LIBRARY_PATH=$PTDIR/lib $PTDIR/bin/PacketTracer7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env sh | |
| if [ ! -d $HOME/pt ]; then | |
| mkdir -p $HOME/pt; | |
| fi | |
| if [ ! -f $HOME/.packettracer ]; then | |
| touch $HOME/.packettracer | |
| fi | |
| docker run -it --rm \ | |
| --net host \ | |
| --privileged=true \ | |
| -v $HOME/pt:/home/pt/pt:Z \ | |
| -v $HOME/.packettracer:/home/pt/.packettracer \ | |
| -v $HOME/Downloads:/home/pt/Downloads \ | |
| -v /tmp/.X11-unix:/tmp/.X11-unix \ | |
| -e DISPLAY=unix$DISPLAY \ | |
| packettracer7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, i'm new in docker, how do i run the PT after i create Dockerfile and packettracer7.sh.
Should i docker-compose and what is the command to run the PT.
Hope you can help me.
Thanks