Skip to content

Commit

Permalink
Merge pull request #80 from bcbi/dpa/parent-image
Browse files Browse the repository at this point in the history
Document the `parent_image` keyword argument
  • Loading branch information
DilumAluthge authored May 12, 2020
2 parents 310b41b + 0592fb9 commit 21ba611
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/predictmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- run: julia --project -e 'import SimpleContainerGenerator; pkgs = [(name = "PredictMD", rev = "master", ), (name = "PredictMDExtra", rev = "master", ), (name = "PredictMDFull", rev = "master", ), (name = "UnicodePlots", version = "1.2.0 - *", ),]; no_test = String["UnicodePlots"]; SimpleContainerGenerator.create_dockerfile(pkgs; no_test = no_test)'
- run: julia --project -e 'import SimpleContainerGenerator; pkgs = [(name = "PredictMD", rev = "master", ), (name = "PredictMDExtra", rev = "master", ), (name = "PredictMDFull", rev = "master", ), (name = "UnicodePlots", version = "1.2.0 - *", ),]; no_test = String["UnicodePlots"]; parent_image = "nvidia/cuda"; SimpleContainerGenerator.create_dockerfile(pkgs; no_test = no_test, parent_image = parent_image)'
- if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule')
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SimpleContainerGenerator"
uuid = "b8d349fb-717b-4aac-a9b1-e1da4219c631"
authors = ["Dilum Aluthge"]
version = "1.1.1"
version = "1.2.0"

[deps]
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
Expand Down
102 changes: 98 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ pkgs = [
"Bar",
"Baz",
]
julia_version = v"1.4.0"

SimpleContainerGenerator.create_dockerfile(pkgs,
pwd();
julia_version = julia_version)

SimpleContainerGenerator.create_dockerfile(pkgs, pwd(); julia_version = v"1.4.0")
run(`docker build -t my_docker_username/my_image_name .`)
```

Expand All @@ -51,8 +55,12 @@ pkgs = [
(name = "Bar",),
(name = "Baz",),
]
julia_version = v"1.4.0"

SimpleContainerGenerator.create_dockerfile(pkgs,
pwd();
julia_version = julia_version)

SimpleContainerGenerator.create_dockerfile(pkgs, pwd(); julia_version = v"1.4.0")
run(`docker build -t my_docker_username/my_image_name .`)
```

Expand All @@ -69,8 +77,12 @@ pkgs = [
(name = "Bar", version = "4.5.6",), # and replace the version numbers with actual version numbers for the packages
(name = "Baz", version = "7.8.9",),
]
julia_version = v"1.4.0"

SimpleContainerGenerator.create_dockerfile(pkgs,
pwd();
julia_version = julia_version)

SimpleContainerGenerator.create_dockerfile(pkgs, pwd(); julia_version = v"1.4.0")
run(`docker build -t my_docker_username/my_image_name .`)
```

Expand All @@ -87,8 +99,90 @@ pkgs = [
(name = "Bar", version = "4.5.6",), # and replace the version numbers with actual version numbers for the packages
(name = "Baz", rev = "master",), # and replace "master" with the name of the branch you want to use
]
julia_version = v"1.4.0"

SimpleContainerGenerator.create_dockerfile(pkgs,
pwd();
julia_version = julia_version)

run(`docker build -t my_docker_username/my_image_name .`)
```

### Example 5

```julia
import SimpleContainerGenerator

mkpath("my_image_name")
cd("my_image_name")

pkgs = [
"Foo", # Replace Foo, Bar, Baz, etc. with the names of actual packages that you want to use
"Bar",
"Baz",
]
no_test = [
"Foo", # Replace Foo, etc. with the names of actual packages
]
exclude_packages_from_sysimage = [
"Bar", # Replace Bar, etc. with the names of actual packages
]
julia_version = v"1.4.0"

SimpleContainerGenerator.create_dockerfile(pkgs,
pwd();
julia_version = julia_version,
no_test = no_test,
exclude_packages_from_sysimage = exclude_packages_from_sysimage)

run(`docker build -t my_docker_username/my_image_name .`)
```

### Example 6

```julia
import SimpleContainerGenerator

mkpath("my_image_name")
cd("my_image_name")

pkgs = [
"Foo", # Replace Foo, Bar, Baz, etc. with the names of actual packages that you want to use
"Bar",
"Baz",
]
julia_version = v"1.4.0"
parent_image = "ubuntu:latest"

SimpleContainerGenerator.create_dockerfile(pkgs,
pwd();
julia_version = julia_version,
parent_image = parent_image)

run(`docker build -t my_docker_username/my_image_name .`)
```

### Example 7

```julia
import SimpleContainerGenerator

mkpath("my_image_name")
cd("my_image_name")

pkgs = [
"Foo", # Replace Foo, Bar, Baz, etc. with the names of actual packages that you want to use
"Bar",
"Baz",
]
julia_version = v"1.4.0"
parent_image = "nvidia/cuda:latest"

SimpleContainerGenerator.create_dockerfile(pkgs,
pwd();
julia_version = julia_version,
parent_image = parent_image)

SimpleContainerGenerator.create_dockerfile(pkgs, pwd(); julia_version = v"1.4.0")
run(`docker build -t my_docker_username/my_image_name .`)
```

Expand Down
1 change: 1 addition & 0 deletions src/public_create_dockerfile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const _create_dockerfile_kwargs_docstring = """
- `julia_version::Union{String, VersionNumber}`
- `make_sysimage::Bool`
- `no_test::Vector{String}`
- `parent_image::String`
### Advanced Keyword Arguments
- `override_default_apt::Vector{String}`
Expand Down

2 comments on commit 21ba611

@DilumAluthge
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register branch=master

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/14607

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.2.0 -m "<description of version>" 21ba611bb12f838eb8c41209865e708a58b27a13
git push origin v1.2.0

Please sign in to comment.