Replies: 2 comments
-
I was able to work around this by using a dockerfile instead: FROM mcr.microsoft.com/devcontainers/base:bullseye
RUN sudo apt-get update\
&& sudo apt-get install -y --no-install-recommends\
perl cpanminus\
libdbd-mysql-perl
# Install [Sqitch](https://sqitch.org/)
RUN cpanm --verbose --notest install App::Sqitch However, I still have an issue while attempting to run some configuration as part of my My question therefore remains the same: what makes I would also like to add: Is the difference in behavior documented somewhere? |
Beta Was this translation helpful? Give feedback.
-
The The local
The thinking at the time was that the container should be "personalized" (dotfiles and .gitconfig) only after postCreateCommand finished up the container's setup. postStartCommand can be used to work around this, though that indeed runs each time the container was restarted. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure where to report this but I'll start here:
As part of my
postCreateCommand
for amcr.microsoft.com/devcontainers/base:bullseye
devcontainer, I'm trying to run a script containing:export PERL_MM_USE_DEFAULT=1 cpan -T install App::Sqitch DBD::mysql
Unfortunately, this fails with:
However, if I execute the script manually just after container creation, it works fine.
Any ideas what makes
postCreateCommand
work differently from using the terminal manually?Reproduction
devcontainer.json
I have also tried
postCreateCommand
:bash my_script.sh
PERL_MM_USE_DEFAULT=1 cpan -T install App::Sqitch DBD::mysql
bash -c \"PERL_MM_USE_DEFAULT=1 cpan -T install App::Sqitch DBD::mysql\"
with identical results
my_script.sh
(optional)Logs
When run using
postCreateCommand
When run manually after devcontainer creation (no
postCreateCommand
)(aborted with Ctrl+C)
Some additional context on the failing perl code
I'm not sure where the
$CPAN::Config->{shell}
variable is set but it seems to be the reason of the failure.System information
Host system
VSCode
Version: 1.87.2
Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
Date: 2024-03-08T15:14:59.643Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 5.15.0-101-generic snap
Devcontainer
mcr.microsoft.com/devcontainers/base:bullseye
(Not sure how to get anything more exact asdocker inspect --type image mcr.microsoft.com/devcontainers/base:bullseye
claims no such image exists)$ lsb_release -a && uname -r No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye 5.15.0-101-generic
Beta Was this translation helpful? Give feedback.
All reactions