How to install mcrypt on Docker
I have a Docker Container with Phalcon3 and php 7. I am trying to install the php extension Mcrypt without luck.
If I do ssh to the container, and execute:
apt-get update
apt-get install php7.0-mcrypt
I get the following:
E: Unable to locate package php7.0-mcrypt
E: Couldn't find any package by regex 'php7.0-mcrypt'
Is there a way to get it installed?
docker mcrypt php-extension
add a comment |
I have a Docker Container with Phalcon3 and php 7. I am trying to install the php extension Mcrypt without luck.
If I do ssh to the container, and execute:
apt-get update
apt-get install php7.0-mcrypt
I get the following:
E: Unable to locate package php7.0-mcrypt
E: Couldn't find any package by regex 'php7.0-mcrypt'
Is there a way to get it installed?
docker mcrypt php-extension
you should always begin with aapt-get updateso try something along the lines ofapt-get update && apt-get install -y php7.0-mcryptthe update first is necessary because you may use an OS (ubuntu, Debian or such) that has had many updates since its arrival. By the way,sudois not necessary, you are root unless you doUSER myuser
– user2915097
Nov 8 '17 at 14:08
have a look at hub.docker.com/r/phpdocker/phpdocker/~/dockerfile (and the lineFROM php:7.1-fpmis built on Debian)
– user2915097
Nov 8 '17 at 14:10
@user2915097 Sorry, yes I do apt-get update, and you are right sudo is not necesary in fact it complains about it. I updated the commands. Also Im traying to modify an existing container, not creating a new one, as you recommend on your second comment.
– subharb
Nov 8 '17 at 14:45
Post the Dockerfile, it will be simpler
– user2915097
Nov 8 '17 at 15:05
add a comment |
I have a Docker Container with Phalcon3 and php 7. I am trying to install the php extension Mcrypt without luck.
If I do ssh to the container, and execute:
apt-get update
apt-get install php7.0-mcrypt
I get the following:
E: Unable to locate package php7.0-mcrypt
E: Couldn't find any package by regex 'php7.0-mcrypt'
Is there a way to get it installed?
docker mcrypt php-extension
I have a Docker Container with Phalcon3 and php 7. I am trying to install the php extension Mcrypt without luck.
If I do ssh to the container, and execute:
apt-get update
apt-get install php7.0-mcrypt
I get the following:
E: Unable to locate package php7.0-mcrypt
E: Couldn't find any package by regex 'php7.0-mcrypt'
Is there a way to get it installed?
docker mcrypt php-extension
docker mcrypt php-extension
edited Nov 8 '17 at 14:44
subharb
asked Nov 8 '17 at 13:47
subharbsubharb
1,55862464
1,55862464
you should always begin with aapt-get updateso try something along the lines ofapt-get update && apt-get install -y php7.0-mcryptthe update first is necessary because you may use an OS (ubuntu, Debian or such) that has had many updates since its arrival. By the way,sudois not necessary, you are root unless you doUSER myuser
– user2915097
Nov 8 '17 at 14:08
have a look at hub.docker.com/r/phpdocker/phpdocker/~/dockerfile (and the lineFROM php:7.1-fpmis built on Debian)
– user2915097
Nov 8 '17 at 14:10
@user2915097 Sorry, yes I do apt-get update, and you are right sudo is not necesary in fact it complains about it. I updated the commands. Also Im traying to modify an existing container, not creating a new one, as you recommend on your second comment.
– subharb
Nov 8 '17 at 14:45
Post the Dockerfile, it will be simpler
– user2915097
Nov 8 '17 at 15:05
add a comment |
you should always begin with aapt-get updateso try something along the lines ofapt-get update && apt-get install -y php7.0-mcryptthe update first is necessary because you may use an OS (ubuntu, Debian or such) that has had many updates since its arrival. By the way,sudois not necessary, you are root unless you doUSER myuser
– user2915097
Nov 8 '17 at 14:08
have a look at hub.docker.com/r/phpdocker/phpdocker/~/dockerfile (and the lineFROM php:7.1-fpmis built on Debian)
– user2915097
Nov 8 '17 at 14:10
@user2915097 Sorry, yes I do apt-get update, and you are right sudo is not necesary in fact it complains about it. I updated the commands. Also Im traying to modify an existing container, not creating a new one, as you recommend on your second comment.
– subharb
Nov 8 '17 at 14:45
Post the Dockerfile, it will be simpler
– user2915097
Nov 8 '17 at 15:05
you should always begin with a
apt-get update so try something along the lines of apt-get update && apt-get install -y php7.0-mcrypt the update first is necessary because you may use an OS (ubuntu, Debian or such) that has had many updates since its arrival. By the way, sudo is not necessary, you are root unless you do USER myuser– user2915097
Nov 8 '17 at 14:08
you should always begin with a
apt-get update so try something along the lines of apt-get update && apt-get install -y php7.0-mcrypt the update first is necessary because you may use an OS (ubuntu, Debian or such) that has had many updates since its arrival. By the way, sudo is not necessary, you are root unless you do USER myuser– user2915097
Nov 8 '17 at 14:08
have a look at hub.docker.com/r/phpdocker/phpdocker/~/dockerfile (and the line
FROM php:7.1-fpm is built on Debian)– user2915097
Nov 8 '17 at 14:10
have a look at hub.docker.com/r/phpdocker/phpdocker/~/dockerfile (and the line
FROM php:7.1-fpm is built on Debian)– user2915097
Nov 8 '17 at 14:10
@user2915097 Sorry, yes I do apt-get update, and you are right sudo is not necesary in fact it complains about it. I updated the commands. Also Im traying to modify an existing container, not creating a new one, as you recommend on your second comment.
– subharb
Nov 8 '17 at 14:45
@user2915097 Sorry, yes I do apt-get update, and you are right sudo is not necesary in fact it complains about it. I updated the commands. Also Im traying to modify an existing container, not creating a new one, as you recommend on your second comment.
– subharb
Nov 8 '17 at 14:45
Post the Dockerfile, it will be simpler
– user2915097
Nov 8 '17 at 15:05
Post the Dockerfile, it will be simpler
– user2915097
Nov 8 '17 at 15:05
add a comment |
3 Answers
3
active
oldest
votes
Lets look at official manual for php docker image Section PHP Core Extensions
For example, if you want to have a PHP-FPM image with iconv, mcrypt
and gd extensions, you can inherit the base image that you like, and
write your own Dockerfile like this:
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libmcrypt-dev
libpng-dev
&& docker-php-ext-install -j$(nproc) iconv mcrypt
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
&& docker-php-ext-install -j$(nproc) gd
Rember, you must install dependencies for your extensions manually. If
an extension needs custom configure arguments, you can use the
docker-php-ext-configure script like this example. There is no need to
run docker-php-source manually in this case, since that is handled by
the configure and install scripts.
1
Thank you that was great help. You can also ssh on the container and execute that same command: apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
– subharb
Nov 9 '17 at 7:47
add a comment |
From PHP manual:
This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 7.2.0.
So in your Dockerfile you have to:
RUN apt-get install libmcrypt-dev
RUN pecl install mcrypt-1.0.1 && docker-php-ext-enable mcrypt
Seems to work, but under Lando not completely. Or do I need add something there? stackoverflow.com/questions/54752814/…
– ñull
Feb 18 at 17:57
add a comment |
i added the code to my Dockerfile but i get this Error
error: /usr/src/php/ext/mcrypt does not exist
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47181369%2fhow-to-install-mcrypt-on-docker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Lets look at official manual for php docker image Section PHP Core Extensions
For example, if you want to have a PHP-FPM image with iconv, mcrypt
and gd extensions, you can inherit the base image that you like, and
write your own Dockerfile like this:
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libmcrypt-dev
libpng-dev
&& docker-php-ext-install -j$(nproc) iconv mcrypt
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
&& docker-php-ext-install -j$(nproc) gd
Rember, you must install dependencies for your extensions manually. If
an extension needs custom configure arguments, you can use the
docker-php-ext-configure script like this example. There is no need to
run docker-php-source manually in this case, since that is handled by
the configure and install scripts.
1
Thank you that was great help. You can also ssh on the container and execute that same command: apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
– subharb
Nov 9 '17 at 7:47
add a comment |
Lets look at official manual for php docker image Section PHP Core Extensions
For example, if you want to have a PHP-FPM image with iconv, mcrypt
and gd extensions, you can inherit the base image that you like, and
write your own Dockerfile like this:
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libmcrypt-dev
libpng-dev
&& docker-php-ext-install -j$(nproc) iconv mcrypt
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
&& docker-php-ext-install -j$(nproc) gd
Rember, you must install dependencies for your extensions manually. If
an extension needs custom configure arguments, you can use the
docker-php-ext-configure script like this example. There is no need to
run docker-php-source manually in this case, since that is handled by
the configure and install scripts.
1
Thank you that was great help. You can also ssh on the container and execute that same command: apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
– subharb
Nov 9 '17 at 7:47
add a comment |
Lets look at official manual for php docker image Section PHP Core Extensions
For example, if you want to have a PHP-FPM image with iconv, mcrypt
and gd extensions, you can inherit the base image that you like, and
write your own Dockerfile like this:
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libmcrypt-dev
libpng-dev
&& docker-php-ext-install -j$(nproc) iconv mcrypt
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
&& docker-php-ext-install -j$(nproc) gd
Rember, you must install dependencies for your extensions manually. If
an extension needs custom configure arguments, you can use the
docker-php-ext-configure script like this example. There is no need to
run docker-php-source manually in this case, since that is handled by
the configure and install scripts.
Lets look at official manual for php docker image Section PHP Core Extensions
For example, if you want to have a PHP-FPM image with iconv, mcrypt
and gd extensions, you can inherit the base image that you like, and
write your own Dockerfile like this:
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libmcrypt-dev
libpng-dev
&& docker-php-ext-install -j$(nproc) iconv mcrypt
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
&& docker-php-ext-install -j$(nproc) gd
Rember, you must install dependencies for your extensions manually. If
an extension needs custom configure arguments, you can use the
docker-php-ext-configure script like this example. There is no need to
run docker-php-source manually in this case, since that is handled by
the configure and install scripts.
edited Nov 8 '17 at 18:10
answered Nov 8 '17 at 15:51
Bukharov SergeyBukharov Sergey
4,43711839
4,43711839
1
Thank you that was great help. You can also ssh on the container and execute that same command: apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
– subharb
Nov 9 '17 at 7:47
add a comment |
1
Thank you that was great help. You can also ssh on the container and execute that same command: apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
– subharb
Nov 9 '17 at 7:47
1
1
Thank you that was great help. You can also ssh on the container and execute that same command: apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
– subharb
Nov 9 '17 at 7:47
Thank you that was great help. You can also ssh on the container and execute that same command: apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
– subharb
Nov 9 '17 at 7:47
add a comment |
From PHP manual:
This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 7.2.0.
So in your Dockerfile you have to:
RUN apt-get install libmcrypt-dev
RUN pecl install mcrypt-1.0.1 && docker-php-ext-enable mcrypt
Seems to work, but under Lando not completely. Or do I need add something there? stackoverflow.com/questions/54752814/…
– ñull
Feb 18 at 17:57
add a comment |
From PHP manual:
This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 7.2.0.
So in your Dockerfile you have to:
RUN apt-get install libmcrypt-dev
RUN pecl install mcrypt-1.0.1 && docker-php-ext-enable mcrypt
Seems to work, but under Lando not completely. Or do I need add something there? stackoverflow.com/questions/54752814/…
– ñull
Feb 18 at 17:57
add a comment |
From PHP manual:
This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 7.2.0.
So in your Dockerfile you have to:
RUN apt-get install libmcrypt-dev
RUN pecl install mcrypt-1.0.1 && docker-php-ext-enable mcrypt
From PHP manual:
This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 7.2.0.
So in your Dockerfile you have to:
RUN apt-get install libmcrypt-dev
RUN pecl install mcrypt-1.0.1 && docker-php-ext-enable mcrypt
answered Nov 25 '18 at 9:17
thanosasimothanosasimo
594
594
Seems to work, but under Lando not completely. Or do I need add something there? stackoverflow.com/questions/54752814/…
– ñull
Feb 18 at 17:57
add a comment |
Seems to work, but under Lando not completely. Or do I need add something there? stackoverflow.com/questions/54752814/…
– ñull
Feb 18 at 17:57
Seems to work, but under Lando not completely. Or do I need add something there? stackoverflow.com/questions/54752814/…
– ñull
Feb 18 at 17:57
Seems to work, but under Lando not completely. Or do I need add something there? stackoverflow.com/questions/54752814/…
– ñull
Feb 18 at 17:57
add a comment |
i added the code to my Dockerfile but i get this Error
error: /usr/src/php/ext/mcrypt does not exist
add a comment |
i added the code to my Dockerfile but i get this Error
error: /usr/src/php/ext/mcrypt does not exist
add a comment |
i added the code to my Dockerfile but i get this Error
error: /usr/src/php/ext/mcrypt does not exist
i added the code to my Dockerfile but i get this Error
error: /usr/src/php/ext/mcrypt does not exist
answered Aug 23 '18 at 6:54
Dennis SchafferDennis Schaffer
667
667
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47181369%2fhow-to-install-mcrypt-on-docker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you should always begin with a
apt-get updateso try something along the lines ofapt-get update && apt-get install -y php7.0-mcryptthe update first is necessary because you may use an OS (ubuntu, Debian or such) that has had many updates since its arrival. By the way,sudois not necessary, you are root unless you doUSER myuser– user2915097
Nov 8 '17 at 14:08
have a look at hub.docker.com/r/phpdocker/phpdocker/~/dockerfile (and the line
FROM php:7.1-fpmis built on Debian)– user2915097
Nov 8 '17 at 14:10
@user2915097 Sorry, yes I do apt-get update, and you are right sudo is not necesary in fact it complains about it. I updated the commands. Also Im traying to modify an existing container, not creating a new one, as you recommend on your second comment.
– subharb
Nov 8 '17 at 14:45
Post the Dockerfile, it will be simpler
– user2915097
Nov 8 '17 at 15:05