Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazydevelop-devcontainer-temp
devcontainer-features
Commits
964e4a34
Unverified
Commit
964e4a34
authored
Aug 31, 2022
by
Samruddhi Khandale
Committed by
GitHub
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Anaconda - Clean up and shrink size (#121)
* shrink conda * bump version
parent
8f64809e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
20 deletions
+30
-20
devcontainer-feature.json
src/anaconda/devcontainer-feature.json
+5
-3
install.sh
src/anaconda/install.sh
+25
-17
No files found.
src/anaconda/devcontainer-feature.json
View file @
964e4a34
{
{
"id"
:
"anaconda"
,
"id"
:
"anaconda"
,
"version"
:
"1.0.
3
"
,
"version"
:
"1.0.
4
"
,
"name"
:
"Anaconda"
,
"name"
:
"Anaconda"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/anaconda"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/anaconda"
,
"options"
:
{
"options"
:
{
"version"
:
{
"version"
:
{
"type"
:
"string"
,
"type"
:
"string"
,
"proposals"
:
[
"proposals"
:
[
"latest"
"latest"
,
"4.11.0"
,
"4.12.0"
],
],
"default"
:
"latest"
,
"default"
:
"latest"
,
"description"
:
"Select or enter an anaconda version."
"description"
:
"Select or enter an anaconda version."
}
}
},
},
"containerEnv"
:
{
"containerEnv"
:
{
"CONDA_DIR"
:
"/
usr/local
/conda"
,
"CONDA_DIR"
:
"/
opt
/conda"
,
"PATH"
:
"${PATH}:${CONDA_DIR}/bin:"
"PATH"
:
"${PATH}:${CONDA_DIR}/bin:"
}
}
}
}
src/anaconda/install.sh
View file @
964e4a34
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
VERSION
=
${
VERSION
:-
"latest"
}
VERSION
=
${
VERSION
:-
"latest"
}
USERNAME
=
${
USERNAME
:-
"automatic"
}
USERNAME
=
${
USERNAME
:-
"automatic"
}
UPDATE_RC
=
${
UPDATE_RC
:-
"true"
}
UPDATE_RC
=
${
UPDATE_RC
:-
"true"
}
CONDA_DIR
=
${
CONDA_DIR
:-
"/usr/local/conda"
}
CONDA_DIR
=
"/opt/conda"
set
-eux
set
-eux
export
DEBIAN_FRONTEND
=
noninteractive
export
DEBIAN_FRONTEND
=
noninteractive
...
@@ -66,6 +66,10 @@ check_packages() {
...
@@ -66,6 +66,10 @@ check_packages() {
if
!
dpkg
-s
"
$@
"
>
/dev/null 2>&1
;
then
if
!
dpkg
-s
"
$@
"
>
/dev/null 2>&1
;
then
apt-get update
-y
apt-get update
-y
apt-get
-y
install
--no-install-recommends
"
$@
"
apt-get
-y
install
--no-install-recommends
"
$@
"
# Clean up
apt-get clean
-y
rm
-rf
/var/lib/apt/lists/
*
fi
fi
}
}
...
@@ -77,29 +81,33 @@ if ! conda --version &> /dev/null ; then
...
@@ -77,29 +81,33 @@ if ! conda --version &> /dev/null ; then
usermod
-a
-G
conda
"
${
USERNAME
}
"
usermod
-a
-G
conda
"
${
USERNAME
}
"
# Install dependencies
# Install dependencies
check_packages wget ca-certificates
check_packages curl ca-certificates gnupg2
mkdir
-p
$CONDA_DIR
chown
-R
"
${
USERNAME
}
:conda"
"
${
CONDA_DIR
}
"
chmod
-R
g+r+w
"
${
CONDA_DIR
}
"
find
"
${
CONDA_DIR
}
"
-type
d
-print0
| xargs
-n
1
-0
chmod
g+s
echo
"Installing Anaconda..."
echo
"Installing Anaconda..."
CONDA_VERSION
=
$VERSION
curl
-sS
https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg
--dearmor
>
/usr/share/keyrings/conda-archive-keyring.gpg
if
[
"
${
VERSION
}
"
=
"latest"
]
||
[
"
${
VERSION
}
"
=
"lts"
]
;
then
echo
"deb [arch=
$(
dpkg
--print-architecture
)
signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main"
>
/etc/apt/sources.list.d/conda.list
CONDA_VERSION
=
"2021.11"
CONDA_PKG
=
"conda=
${
VERSION
}
-0"
if
[
"
${
VERSION
}
"
=
"latest"
]
;
then
CONDA_PKG
=
"conda"
fi
fi
su
--login
-c
"wget -q https://repo.anaconda.com/archive/Anaconda3-
${
CONDA_VERSION
}
-Linux-x86_64.sh -O /tmp/anaconda-install.sh
\
check_packages
$CONDA_PKG
&& /bin/bash /tmp/anaconda-install.sh -u -b -p
${
CONDA_DIR
}
"
${
USERNAME
}
2>&1
if
[
"
${
VERSION
}
"
=
"latest"
]
||
[
"
${
VERSION
}
"
=
"lts"
]
;
then
CONDA_SCRIPT
=
"/opt/conda/etc/profile.d/conda.sh"
PATH
=
$PATH
:
${
CONDA_DIR
}
/bin
.
$CONDA_SCRIPT
conda update
-y
conda
fi
conda config
--add
channels conda-forge
conda config
--set
channel_priority strict
conda config
--set
env_prompt
'({name})'
echo
"source
${
CONDA_SCRIPT
}
"
>>
~/.bashrc
chown
-R
"
${
USERNAME
}
:conda"
"
${
CONDA_DIR
}
"
chmod
-R
g+r+w
"
${
CONDA_DIR
}
"
find
"
${
CONDA_DIR
}
"
-type
d
-print0
| xargs
-n
1
-0
chmod
g+s
rm
/tmp/anaconda-install.sh
updaterc
"export CONDA_DIR=
${
CONDA_DIR
}
/bin"
updaterc
"export CONDA_DIR=
${
CONDA_DIR
}
/bin"
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment