Answers: <p><code>dev</code> packages are typically intended for development and build purposes. They usually contain header files and other resources for providing programmer APIs. For example, <code>python-dev</code> contains C headers for C/C++ applications that integrate python functionalities (which of course isn't necessarily python itself).</p>
  
  <p>The "non-dev" packages provide the actual application or library: for example, <code>python</code> provides the python interpreter binary, the <code>libpython3.so</code> shared library, and compiled python modules.</p>
  
  <p>For inspecting the contents of specific packages, you could use Alpine's excellent <a href="https://pkgs.alpinelinux.org/packages" rel="nofollow noreferrer">package explorer</a>: locate the package of interest (for example, <a href="https://pkgs.alpinelinux.org/package/v3.9/main/x86_64/python3-dev" rel="nofollow noreferrer"><code>python3-dev</code></a>), and click the "Contents of package " link at the bottom, to see the complete list of files installed by the package.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-05-05T07:59:20.310Z
Answers: 2019-05-05T13:00:27.377Z
Answers: 2019-05-05T13:00:27.377Z
Answers: valiano
Body: <p>I recently started a new position at a company that is transitioning over to docker for local and prod, and inherited a few 'base image' repositories for php, node and a few others.</p>
  
  <p>Unfortunately the creator is no longer at the company, so I'm going through the system and trying to piece it together. None of the images are used in production yet, and it's fair to say they are probably not road ready yet.</p>
  
  <p>The images are based off alpine and I noticed particularly in the php image that most of the apk dependencies are using <code>-dev</code> distros:</p>
  
  <pre><code>apk add --no-cache $PHPIZE_DEPS bzip2-dev freetype-dev gmp-dev icu-dev ...
  </code></pre>
  
  <p>I couldn't easily find out the difference between, for example, <code>bzip2</code> and <code>bzip2-dev</code> but my assumption would be that these packages are aimed at people who develop those packages. Next best guess would be they have some advantage for general developers (php in this example) but if so I'm not sure what those benefits would be.</p>
  
  <p>What is the purpose of the <code>-dev</code> packages, and perhaps some guidance on where they would be appropriate (e.g. local only or fine for prod?)</p>
  
Tags: <docker><php><alpine>
Title: How do -dev apk packages differ on Alpine for the purposes of creating docker images?
UserDisplayName: Max Colledge
ThreadText: # How do -dev apk packages differ on Alpine for the purposes of creating docker images?
  
  (Asked by: username_0 on 2019-05-03)
  
  I recently started a new position at a company that is transitioning over to docker for local and prod, and inherited a few 'base image' repositories for php, node and a few others.
  
  Unfortunately the creator is no longer at the company, so I'm going through the system and trying to piece it together. None of the images are used in production yet, and it's fair to say they are probably not road ready yet.
  
  The images are based off alpine and I noticed particularly in the php image that most of the apk dependencies are using `-dev` distros:
  
  ```
  apk add --no-cache $PHPIZE_DEPS bzip2-dev freetype-dev gmp-dev icu-dev ...
  
  ```
  
  I couldn't easily find out the difference between, for example, `bzip2` and `bzip2-dev` but my assumption would be that these packages are aimed at people who develop those packages. Next best guess would be they have some advantage for general developers (php in this example) but if so I'm not sure what those benefits would be.
  
  What is the purpose of the `-dev` packages, and perhaps some guidance on where they would be appropriate (e.g. local only or fine for prod?)
  
  **Tags:** docker, php, alpine
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-05. Score: 1 | Accepted answer
  
  `dev` packages are typically intended for development and build purposes. They usually contain header files and other resources for providing programmer APIs. For example, `python-dev` contains C headers for C/C++ applications that integrate python functionalities (which of course isn't necessarily python itself).
  
  The "non-dev" packages provide the actual application or library: for example, `python` provides the python interpreter binary, the `libpython3.so` shared library, and compiled python modules.
  
  For inspecting the contents of specific packages, you could use Alpine's excellent [package explorer](https://pkgs.alpinelinux.org/packages): locate the package of interest (for example, [`python3-dev`](https://pkgs.alpinelinux.org/package/v3.9/main/x86_64/python3-dev)), and click the "Contents of package " link at the bottom, to see the complete list of files installed by the package.
  
  
  ---
  
  