├── .github └── workflows │ └── docker-publish.yml ├── Dockerfile ├── LICENSE ├── README.md └── postcreate.jl /.github/workflows/docker-publish.yml: -------------------------------------------------------------------------------- 1 | name: Docker 2 | 3 | on: 4 | push: 5 | # Publish `master` as Docker `latest` image. 6 | branches: 7 | - master 8 | 9 | # Publish `v1.2.3` tags as releases. 10 | tags: 11 | - v* 12 | 13 | # Run tests for any PRs. 14 | pull_request: 15 | 16 | env: 17 | IMAGE_NAME: julia-devcontainer 18 | 19 | jobs: 20 | # Run tests. 21 | # See also https://docs.docker.com/docker-hub/builds/automated-testing/ 22 | test: 23 | runs-on: ubuntu-latest 24 | 25 | steps: 26 | - uses: actions/checkout@v2 27 | 28 | - name: Run tests 29 | run: | 30 | if [ -f docker-compose.test.yml ]; then 31 | docker-compose --file docker-compose.test.yml build 32 | docker-compose --file docker-compose.test.yml run sut 33 | else 34 | docker build . --file Dockerfile 35 | fi 36 | 37 | # Push image to GitHub Packages. 38 | # See also https://docs.docker.com/docker-hub/builds/ 39 | build: 40 | # Ensure test job passes before pushing image. 41 | needs: test 42 | 43 | runs-on: ubuntu-latest 44 | if: github.event_name == 'push' 45 | 46 | strategy: 47 | matrix: 48 | julia-version: ['1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4', '1.0.5', '1.1.0', '1.1.1', '1.2.0', '1.3.0', '1.3.1', '1.4.0', '1.4.1', '1.4.2', '1.5.0', '1.5.1', '1.5.2', '1.5.3', '1.5.4', '1.6.0', '1.6.1', '1.6.2', '1.6.3', '1.6.4', '1.6.5', '1.6.6', '1.6.7', '1.7.0', '1.7.1', '1.7.2', '1.7.3', '1.8.0', '1.8.1', '1.8.2', '1.8.3', '1.8.4', '1.8.5', '1.9.0', '1.9.1', '1.9.2', '1.9.3', '1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '1'] 49 | 50 | steps: 51 | - uses: actions/checkout@v2 52 | 53 | - name: Build image 54 | run: docker build . --file Dockerfile --tag $IMAGE_NAME --build-arg JULIA_VERSION=${{ matrix.julia-version }} 55 | 56 | - name: Log into GitHub Container Registry 57 | run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin 58 | 59 | - name: Push image to GitHub Container Registry 60 | run: | 61 | IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME 62 | 63 | # Change all uppercase to lowercase 64 | IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') 65 | 66 | # Strip git ref prefix from version 67 | VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') 68 | 69 | # Strip "v" prefix from tag name 70 | [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') 71 | 72 | # Use Docker `latest` tag convention 73 | [ "$VERSION" == "master" ] && VERSION=latest 74 | 75 | VERSION=${{ matrix.julia-version }} 76 | 77 | echo IMAGE_ID=$IMAGE_ID 78 | echo VERSION=$VERSION 79 | 80 | docker tag $IMAGE_NAME $IMAGE_ID:$VERSION 81 | docker push $IMAGE_ID:$VERSION 82 | 83 | buildlatest: 84 | # Ensure test job passes before pushing image. 85 | needs: build 86 | 87 | runs-on: ubuntu-latest 88 | if: github.event_name == 'push' 89 | 90 | steps: 91 | - uses: actions/checkout@v2 92 | 93 | - name: Build image 94 | run: docker build . --file Dockerfile --tag $IMAGE_NAME --build-arg JULIA_VERSION=latest 95 | 96 | - name: Log into GitHub Container Registry 97 | run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin 98 | 99 | - name: Push image to GitHub Container Registry 100 | run: | 101 | IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME 102 | 103 | # Change all uppercase to lowercase 104 | IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') 105 | 106 | # Strip git ref prefix from version 107 | VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') 108 | 109 | # Strip "v" prefix from tag name 110 | [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') 111 | 112 | # Use Docker `latest` tag convention 113 | [ "$VERSION" == "master" ] && VERSION=latest 114 | 115 | VERSION=latest 116 | 117 | echo IMAGE_ID=$IMAGE_ID 118 | echo VERSION=$VERSION 119 | 120 | docker tag $IMAGE_NAME $IMAGE_ID:$VERSION 121 | docker push $IMAGE_ID:$VERSION 122 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG JULIA_VERSION=1 2 | FROM julia:${JULIA_VERSION} 3 | 4 | # Options for common setup script 5 | # Install zsh & Oh-My-Zsh 6 | ARG INSTALL_ZSH="true" 7 | # Upgrade OS packages to their latest versions 8 | ARG UPGRADE_PACKAGES="true" 9 | ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh" 10 | ARG COMMON_SCRIPT_SHA="dev-mode" 11 | 12 | # This Dockerfile adds a non-root user with sudo access. Update the “remoteUser” property in 13 | # devcontainer.json to use it. More info: https://aka.ms/vscode-remote/containers/non-root-user. 14 | ARG USERNAME=vscode 15 | ARG USER_UID=1000 16 | ARG USER_GID=$USER_UID 17 | 18 | # Install needed packages and setup non-root user. 19 | RUN apt-get update \ 20 | && export DEBIAN_FRONTEND=noninteractive \ 21 | && apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \ 22 | && curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \ 23 | && ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \ 24 | && /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "false" \ 25 | && rm /tmp/common-setup.sh \ 26 | # Clean up 27 | && apt-get autoremove -y \ 28 | && apt-get clean -y \ 29 | && rm -rf /var/lib/apt/lists/* 30 | 31 | RUN mkdir -p /julia-devcontainer-scripts 32 | 33 | COPY ./postcreate.jl /julia-devcontainer-scripts 34 | 35 | RUN chmod +x /julia-devcontainer-scripts/postcreate.jl 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Julia extension for Visual Studio Code 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deprecated 2 | 3 | This repository is deprecated as the underlying technology has moved to a different way of doing things. The replacement repositories are https://github.com/JuliaLang/devcontainer-features and https://github.com/JuliaLang/devcontainer-templates. 4 | -------------------------------------------------------------------------------- /postcreate.jl: -------------------------------------------------------------------------------- 1 | #!/usr/local/julia/bin/julia 2 | 3 | using Pkg 4 | 5 | function has_manifest_file() 6 | return isfile(joinpath(pwd(),"Manifest.toml")) || isfile(joinpath(pwd(),"JuliaManifest.toml")) 7 | end 8 | 9 | function has_project_file() 10 | return isfile(joinpath(pwd(),"Project.toml")) || isfile(joinpath(pwd(),"JuliaProject.toml")) 11 | end 12 | 13 | function is_package() 14 | return has_project_file() && !has_manifest_file() 15 | end 16 | 17 | function is_app() 18 | return has_project_file() && has_manifest_file() 19 | end 20 | 21 | if is_app() 22 | Pkg.activate(pwd()) 23 | Pkg.instantiate() 24 | elseif is_package() 25 | Pkg.develop(path=pwd()) 26 | end 27 | --------------------------------------------------------------------------------