Skip to content

Commit

Permalink
Merge pull request #4 from CMIPT/develop
Browse files Browse the repository at this point in the history
Fix typos and add sudo before docker command.
  • Loading branch information
Kaiser-Yang authored May 28, 2024
2 parents 5e22ea2 + f07e9e7 commit 934e238
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
[中文版本](README-zh.md)

# Release Log
## Release-v0.1.3
* Fix typos
* Add `sudo` before the `docker update --restart=always` command

## Release-v0.1.0
* Finish basic functionalities of scripts.
* Finish README.md of English version.
## Release-v0.1.2
* Fix a bug: `-v` can not work
* Add an option that can control whether or not to restart the new docker when physical machine restarts

## Release-v0.1.1
* Fix some typos

## Release-v0.1.2
* Fix a bug: `-v` can not work
* Add an option that can control whether or not to restart the new docker when physical machine restarts
## Release-v0.1.0
* Finish basic functionalities of scripts.
* Finish README.md of English version.

# docker-script
Some scripts for creating and configuring dockers.
Expand Down Expand Up @@ -88,12 +91,21 @@ Options:
-h, --help: print the manual page.
Example:
$0 --name newdocker --publish 7777:22 --with-gpu 1 --gpus all -e \\
$0 --name newdocker --publish 7777:22 --with-gpu 1 --gpus all -e \
NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all ubuntu:latest
$0 -n newdocker -p 7777:22
$0 --name newdocker --publish 7777:22 --with-gpu 0 --distro ubuntu:latest --file \\
$0 --name newdocker --publish 7777:22 --with-gpu 0 --distro ubuntu:latest --file \
./docker_initializer
$0 -n newdocker -p 7777:22 -w 0
Note:
The second example will acts same as the first one does.
The fourth example will acts same as the third one does.
If you want to pass more than one argument for the same option, you should use more than one
(e.g., -p 22:22 -p 33:33).
```

# Something for Docker Users
Expand Down Expand Up @@ -197,7 +209,7 @@ This part is for someone who wants to add some new scripts to the repository.
As you can see, the repository now only have `install_ubuntu.sh` that works for `ubuntu`. But don't worry if you want to contribute to this repository and make the scripts work for other distros, that is very easy to do. Let me show you how.

Generally, the `create_docker.sh` need no updates. You just need update `docker_initializer/installer.sh` and `docker_initializer/installer_distro.sh` the first one is to chose which installer will be executed, its contents is like this:
Generally, the `create_docker.sh` need no updates. You just need update `docker_initializer/installer.sh` and `docker_initializer/installer_distro.sh` the first one is to chose which installer will be executed, its contents are like the following:

```bash
#!/usr/bin/env bash
Expand All @@ -215,7 +227,7 @@ else
fi
```

What you need to do for this one is simply add a new `elfi`, for example, if you want to add a new installer for `centos`, it may look like this:
What you need to do for this one is simply add a new `elif`, for example, if you want to add a new installer for `centos`, it may look like this:

```bash
#!/usr/bin/env bash
Expand All @@ -236,7 +248,7 @@ else
fi
```

Then you need to update the second file. For this example, you need create a file name `installer_centos.sh` in the same directory. And write what you want to do for the new distro. Here is what I have done in `installer_ubuntu.sh`:
Then you need to update the second file. For this example, you need create a file named `installer_centos.sh` in the same directory. And write what you want to do for the new distro. Here is what I have done in `installer_ubuntu.sh`:

```bash
#!/usr/bin/env bash
Expand Down
2 changes: 1 addition & 1 deletion create_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ if ! confirm_cmd "$docker_enter_cmd"; then
exit 1
fi

autorestart_cmd="docker update --restart=always $pure_name"
autorestart_cmd="$sudo_cmd docker update --restart=always $pure_name"
if [ "$autorestart" -eq 1 ]; then
if ! confirm_cmd "$autorestart_cmd"; then
echo "terminated"
Expand Down

0 comments on commit 934e238

Please sign in to comment.