diff --git a/get_apt_list.sh b/get_apt_list.sh new file mode 100755 index 0000000..54c9441 --- /dev/null +++ b/get_apt_list.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +LINE=$(sed -n '/install.*gedit/=' /var/log/apt/history.log) + +echo "Command list contain \"apt\" or \"apt-get\" from last built" +tail -n +$((LINE+1)) /var/log/apt/history.log | grep -e "Start-Date:" -e "Commandline:" | sed 's/Start-Date: /\n/g' diff --git a/pull.sh b/pull.sh index e77bf77..96eaa80 100755 --- a/pull.sh +++ b/pull.sh @@ -1,6 +1,5 @@ #!/bin/bash LATEST_VERSION=$(curl -s https://registry.hub.docker.com/v1/repositories/bvbnatsu/tsukuba2022/tags | jq -r '.[].name' | tail -n 1) -echo $LATEST_VERSION docker pull bvbnatsu/tsukuba2022:$LATEST_VERSION diff --git a/readme.txt b/readme.txt index 27591c6..8a6966c 100644 --- a/readme.txt +++ b/readme.txt @@ -1,15 +1,24 @@ Requirement - - docker - - curl - - jq + -jq - $ sudo snap install docker - $ sudo apt install curl $ sudo apt install jq Pull latest image $ ./pull.sh -Push image as latest - $ ./push.sh + +Run without any devices(for simulation) + - Latest image exists locally + $ ./runLite.sh + + - or specify tag (ex. v0.0) + $ ./runLite.sh v?.? + + +Copy file or directory + - container -> host + $ docker cp $(docker ps -q):/home/ubuntu/catkin_ws/src + + - host -> container + $ docker cp ./src $(docker ps -q):/home/ubuntu/catkin_ws/ diff --git a/runLite.sh b/runLite.sh index 59b9788..244fddd 100755 --- a/runLite.sh +++ b/runLite.sh @@ -1,3 +1,11 @@ +if [ -n "$1" ]; then + TAG=$1 +else + read REPOSITORY TAG ID CREATED SIZE < <(docker images | grep bvbnatsu) +fi + +echo "Starting bvbnatsu/tsukuba2022:$TAG" + docker run --rm \ -p 6080:80 \ -p 2222:22 \ @@ -6,4 +14,4 @@ -p 8308:8308/udp \ -e RESOLUTION=1920x1080 --shm-size=512m \ -e HOME=/home/ubuntu -e SHELL=/bin/bash \ - --entrypoint '/startup.sh' tsukuba2022:latest + --entrypoint '/startup.sh' bvbnatsu/tsukuba2022:$TAG